Bilibili Triple Ads - Ad Metadata: Check Allowed Values Before Creation

Introduction

When integrating with Bilibili’s “Three-Click” (Sanlian) Auction Advertising MAPI using Agents or scripts, many fields in the campaign, unit, and creative saving interfaces are enums or resource IDs. These values vary based on the advertiser’s account, promotion purpose, promotion content, and placement locations. The full enum list in the documentation cannot be directly treated as the “selectable set for the current account.” If values are filled in based on experience, the common results are saving failures or writing incorrect configurations without the user’s awareness.

The following is an introduction to the Bilibili Sanlian Ads - Ad Metadata (Package ID: bilibili-sanlian-ads-metadata) on SkillHub. Before any save request is assembled, it uses read-only queries to clearly resolve dependencies; both the legacy three-layer creation and Creative Drive 2.0 share the same metadata interface (except for specific capabilities like 2.0 template groups and legacy creative placements).

What is this

Bilibili Sanlian Ads - Ad Metadata is a creation configuration query Skill within the Bilibili Sanlian Ads MAPI Skill family. Author: Benjamin. Current package version: 3.0.6. License: MIT. The SkillHub category is business-ops; the page shows a rating of approximately 98055 and about 2420 downloads (based on SkillHub display).

Positioning in one sentence: It read-only parses the selectable values that save requests depend on; it does not create or modify ad objects. MAPI side queries require a valid access_token and advertiser account_id (if either is missing, first proceed with bilibili-sanlian-ads authorization and account scope); additionally, it provides an independent Bilibili public video info query that only requires a BVID or video link, without needing an ad account.

Official Entry Points:

  • https://api.skillhub.cn/user_b0010d5c/sanlian-ads-metadata
  • https://skillhub.cn/skills/user_b0010d5c/sanlian-ads-metadata

Core Features

The Skill syncs the official “Creation Configuration Query” documentation to references/ and indexes interfaces by scenario. The main capabilities verified via the package’s SKILL.md are as follows.

Creation Chain Metadata

Stage Typical Interface Docs Function
Promotion Purpose 507 Available promotion purposes for current account campaigns/projects
Promotion Content 512 Unit promotion content under a defined promotion purpose
Optimization Goals & Bids 513, 522 Selectable CPA targets, Phase 2 minimum bid ranges
Targeting 520 Selectable targeting dimensions and values for units
Promotion Objects 514–519, 515–517, 1697 Apps, listed games, products, live streams, scheduled live streams, B Mini Programs/Mini Games, etc.
  • Videos & Materials: Deliverable videos (531), Video MIDs (529), Local videos (530), Open Space MIDs (536), Partner authorized tasks (538).
  • Dynamics: Four sources correspond to 532–535 respectively (Available MIDs, Dynamics under MID, Manual binding, Huahuo commercial orders); they cannot be mixed.
  • Playables, Landing Pages, Selling Points: Playable materials (1829), Gaoneng建站 landing pages (537), Paused ad landing pages (1887), Promotion selling points (1942).
  • Components: Video config components (1722), Live stream game card components (1699); component creation is in bilibili-sanlian-ads-assets, this Skill only queries existing configs.
  • Legacy Creative Placements: 527 (Legacy three-layer structure only; 2.0 expresses this via template groups and promotion_scene in bilibili-sanlian-ads-delivery).

Public Video Info (Non-MAPI)

When a user provides a BVID or https://www.bilibili.com/video/{bvid}, the Bilibili public interface GET https://api.bilibili.com/x/web-interface/view can be called to obtain avid, bvid, UPloader, title, description, cover, pagination (P), etc. This does not represent ad authorization or deliverability, nor should it automatically trigger MAPI queries like 531.

Working Constraints (Built-in Rules)

  1. MAPI calls are unified via the package’s scripts/mapi.sh (Windows uses py -3 scripts/mapi_client.py). Base URL: https://cm.bilibili.com/takumi/api. Requires Authorization: Bearer {access_token}, X-Call-Source: sanlian-skills, X-Sanlian-Skills-Version: 3.0.4 (subject to Skill documentation).
  2. Public video queries must not go through mapi.sh call; a standard HTTP client is required, and a browser-style User-Agent must be set to avoid HTTP 412 errors.
  3. Before creation, open references/creation-field-source-map.md. Every value filled into the save body must have a traceable source; an empty result indicates the current account cannot use it. Fallback to hardcoded enums is prohibited.
  4. Query order follows the dependency chain: Promotion Purpose → Promotion Content → Promotion Object → Optimization Goal/Bid → Targeting → Placement → Deliverable Materials → Landing Page/Selling Points etc.

Installation and Activation

The SkillHub official page provides an entry to install or download the Skill package. If a direct link to the zip package is needed (accessible via SkillHub download API), you can use:

curl -L "https://api.skillhub.cn/api/v1/download?slug=sanlian-ads-metadata&namespace=indiv-benjamin" \
  -o sanlian-ads-metadata.zip

After unzipping, place it according to the Skill directory specifications of your Agent (specific mount paths for Cursor, Claude Code, etc. are subject to their respective documentation; this Skill package does not distinguish them internally).

Runtime Environment Requirements (from the related MAPI client description): Python 3.8+, no third-party dependencies. Before the first MAPI metadata call, bilibili-sanlian-ads should be installed and initialized, with OAuth and account_id confirmation completed.

Typical Usage

1. Check Promotion Purpose (507) before Creation

First confirm the account and token, then check the selectable promotion purposes for the current account. Query parameter example:

{
  "account_id": 123456
}

Initiate a GET via the Skill’s bundled client (path subject to references/507_查询计划可用推广目的.md):

cd /path/to/sanlian-ads-metadata
scripts/mapi.sh call GET /open_api/launch/cpc/meta_data/v3/campaign/get_promotion_purpose_type \
  --query-file query.json

The result array in the response body provides promotion_purpose_type and descriptions; subsequent queries like 512, 513 should continue based on the purpose selected here, rather than using the 1711 full enum list as a substitute for the account’s selectable set.

2. Advance Unit Configuration via Dependency Chain

Before saving in bilibili-sanlian-ads-ad-management or bilibili-sanlian-ads-delivery, the Skill suggests the following order:

  1. 507 Determine Promotion Purpose;
  2. 512 Determine Promotion Content;
  3. Call 514/519/518/515 etc. based on content type to get Promotion Objects;
  4. 513, 522 Determine Optimization Goals and Bid Ranges;
  5. 520 Pull Targeting Dimensions;
  6. Legacy uses 527 to check Creative Placements; 2.0 switches to delivery Skill to check template groups;
  7. 531/530/532–535 etc. check deliverable resources based on material type;
  8. 537, 1942, 1722 etc. to complete Landing Pages and Selling Points.

Initiate only one query per step; read the response before proceeding to the next step. Within the same account and task, queried results can be cached to avoid repeat API calls.

3. Check Public Video via BVID Only

curl --location --request GET \
  'https://api.bilibili.com/x/web-interface/view?bvid=BV1GpC7BCE74' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'

Check if code is 0, then extract data.aid, data.title, data.owner etc. as needed; long integer IDs are recommended to be saved as strings.

Applicable Scenarios & Notes

Who is it for

  • Developers or operators doing Sanlian ad creation, order modification, or field validation before reconciliation via Agents;
  • Scenarios needing to convert “BV links provided by users” into structured video info, then manually judging whether to proceed with authorization and deliverability queries.

Limitations & Common Pitfalls

  • This Skill does not upload materials; images/videos go via bilibili-sanlian-ads-materials, authorization relationships go via bilibili-sanlian-ads-assets.
  • The media_id returned by 531 is for 2.0; the video.material_id in 530 is the Creative Center material ID, which is not the same ID space as media_id.
  • B Mini Programs and Mini Games share 1697, distinguished by sort=0 (Mini Program) and sort=2 (Mini Game).
  • MAPI business success/failure is determined by the response body, not the HTTP status code; a 200 may still contain business errors, which need to be interpreted against the corresponding references documentation.

Related Routing Reference: bilibili-sanlian-ads handles authorization and task distribution; saving Campaigns/Units/Creatives uses bilibili-sanlian-ads-ad-management (legacy) or bilibili-sanlian-ads-delivery (2.0). Creation tasks should load this metadata Skill first, then enter the saving Skill.

Conclusion

Bilibili Sanlian Ads - Ad Metadata consolidates the query of selectable values dependent on creation saving into a read-only workflow, and separately covers public video info parsing, reducing failures and misconfigurations caused by enum guessing. For installation or updates, please refer to the SkillHub official page: https://api.skillhub.cn/user_b0010d5c/sanlian-ads-metadata

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye