{"skill":{"slug":"game-market-skill","displayName":"game-market","summary":"Query YY game trading marketplace listings by game and category; guides users to the website for actual buy/sell actions.Game Account Market","description":"---\nname: game-market\ndescription: Query YY game trading marketplace listings by game and category; guides users to the website for actual buy/sell actions\ntriggers:\n  - game trading\n  - game account\n  - account trading\n  - buy account\n  - sell account\n  - boosting\n  - coaching\n  - game currency\n  - game items\n  - 游戏交易\n  - 游戏账号\n  - 账号买卖\n  - 代练\n  - 陪练\n  - 游戏币\n  - 道具\n  - 买账号\n  - 卖账号\n  - 王者荣耀\n  - 英雄联盟\n  - 三角洲行动\n  - 和平精英\n  - 穿越火线\n  - 无畏契约\n  - 绝地求生\n  - 崩坏\n  - 原神\n  - CSGO\n  - YY交易\n  - YY商城\n  - YY游仓\n  - yy游仓\n  - 游仓\n  - mall.yy.com\nargument-hint: \"[game name] [category]\"\n---\n\n# Game Market Skill\n\nQuery YY game trading marketplace listings directly in chat.\nBrowse by game → category → listings → paginate.\nWhen the user wants to actually buy or sell, confirm then open the browser.\n\n**No login required.** The API uses a front-end signature (MD5-based) that is self-contained.\n\n---\n\n## When to Activate\n\nActivate when the user:\n- Runs `/game-market` manually\n- Mentions game trading keywords: game account, buy/sell account, boosting, coaching, game currency, game items\n- Mentions specific game names: 王者荣耀, 英雄联盟, 三角洲行动, 和平精英, 穿越火线, 无畏契约, 绝地求生, 崩坏, 原神, CSGO\n- Mentions YY marketplace: YY交易, YY商城, mall.yy.com\n\n---\n\n## Workflow\n\n### Step 1 — Intent Recognition\n\nExtract from user input:\n- **Game name** → `categoryId`\n- **Sub-category** → `subCategoryId`\n\n| Sub-category | subCategoryId |\n|-------------|--------------|\n| 账号 (Account) | 5 |\n| 代练 (Boosting) | 1 |\n| 陪练 (Coaching) | 2 |\n| 道具 (Items) | 3 |\n| 游戏币 (Currency) | 4 |\n\nIf intent is unclear (game mentioned but no category, or vice versa), go to Step 2.\n\n### Step 2 — Category Selection (when intent is unclear)\n\nRun this Python snippet to fetch and display categories:\n\n```python\nimport hashlib, uuid, time, requests\n\nAPPID  = \"market_app\"\nSECRET = \"ixlOJVDwdOm5rGdudhEywwK6\"\nHDID   = \"38e6a82f5f724517d6cbe82cde56e846690afcb0\"\nBASE   = \"https://gamemarket.yy.com\"\n\ndef sign(uri):\n    nonce = str(uuid.uuid4())\n    ts    = str(int(time.time() * 1000))\n    raw   = f\"appId={APPID}&nonce={nonce}&timestamp={ts}&uri={uri}&secret={SECRET}\"\n    sig   = hashlib.md5(raw.encode()).hexdigest()\n    return {\n        \"accept\": \"application/json, text/plain, */*\",\n        \"origin\": \"https://mall.yy.com\",\n        \"referer\": \"https://mall.yy.com/\",\n        \"user-agent\": \"Mozilla/5.0\",\n        \"x-appid\": APPID, \"x-nonce\": nonce, \"x-timestamp\": ts, \"x-signature\": sig,\n    }\n\nuri  = \"/category/queryShowCategories\"\nresp = requests.get(BASE + uri, params={\"sid\": \"\", \"hdid\": HDID}, headers=sign(uri), timeout=15)\ncats = resp.json()[\"data\"]\n\nfor c in cats:\n    subs = \", \".join(s[\"name\"] for s in c.get(\"subCategories\", []))\n    print(f\"  {c['id']:>2}. {c['name']}  ({subs})\")\n```\n\nPresent the list to the user and ask them to choose game and sub-category.\n\n### Step 3 — Query Listings\n\nRun this Python snippet with the resolved `category_id` and `sub_category_id`:\n\n```python\nimport hashlib, uuid, time, requests\n\nAPPID  = \"market_app\"\nSECRET = \"ixlOJVDwdOm5rGdudhEywwK6\"\nHDID   = \"38e6a82f5f724517d6cbe82cde56e846690afcb0\"\nBASE   = \"https://gamemarket.yy.com\"\n\ndef sign(uri):\n    nonce = str(uuid.uuid4())\n    ts    = str(int(time.time() * 1000))\n    raw   = f\"appId={APPID}&nonce={nonce}&timestamp={ts}&uri={uri}&secret={SECRET}\"\n    sig   = hashlib.md5(raw.encode()).hexdigest()\n    return {\n        \"accept\": \"application/json, text/plain, */*\",\n        \"origin\": \"https://mall.yy.com\",\n        \"referer\": \"https://mall.yy.com/\",\n        \"user-agent\": \"Mozilla/5.0\",\n        \"x-appid\": APPID, \"x-nonce\": nonce, \"x-timestamp\": ts, \"x-signature\": sig,\n    }\n\n# ---- Set these before running ----\ncategory_id     = 5    # None = all games\nsub_category_id = 5\npage_num        = 1\n# ----------------------------------\n\nuri    = \"/goods/v2/search\"\nparams = {\n    \"pageNum\": str(page_num), \"pageSize\": \"20\",\n    \"requestSource\": \"HOME\", \"withRegionServer\": \"true\",\n    \"hdid\": HDID, \"subCategoryId\": str(sub_category_id),\n    \"searchDistChannelGoods\": \"false\",\n}\nif category_id is not None:\n    params[\"categoryId\"] = str(category_id)\n\nresp   = requests.get(BASE + uri, params=params, headers=sign(uri), timeout=15)\nresult = resp.json()[\"data\"]\ngoods  = result.get(\"goodsList\", [])\ntotal  = result.get(\"totalCount\", 0)\n\nprint(f\"Total: {total} listings  |  Page {page_num}\\n\")\nfor i, g in enumerate(goods, 1):\n    price  = g[\"salePrice\"] / 100\n    name   = g[\"goodsName\"].replace(\"\\r\\n\", \" \").replace(\"\\n\", \" \")[:80]\n    labels = \"  \".join(lb[\"labelName\"] for lb in g.get(\"goodsLabels\", []))\n    gid    = g[\"goodsId\"]\n    cat    = g.get(\"categoryName\", \"\")\n    sub    = g.get(\"subCategoryName\", \"\")\n    url    = f\"https://mall.yy.com/?pageId=20000#/shop/detail/{gid}\"\n    print(f\"[{i:02d}] ¥{price:.0f}  {cat} · {sub}\")\n    print(f\"     {name}\")\n    if labels:\n        print(f\"     【{labels}】\")\n    print(f\"     🔗 {url}\\n\")\n```\n\n### Step 4 — Follow-up Interaction\n\nAfter displaying results, keep listening:\n\n| User says | Action |\n|-----------|--------|\n| \"next page\" / \"more\" / \"下一页\" | Increment page_num, re-run Step 3 |\n| \"item N\" / \"open #3\" / \"第N条\" | Open that item's detail URL in browser |\n| \"change game\" / \"换个游戏\" | Back to Step 1 |\n| \"buy\" / \"purchase\" / \"想买\" | → Buy/Sell flow |\n| \"sell\" / \"want to sell\" / \"想卖\" | → Buy/Sell flow |\n\n---\n\n## Buy / Sell Flow\n\nWhen the user expresses intent to buy or sell:\n\n1. **Reply with confirmation prompt:**\n   > To buy or sell, you'll need to use the YY marketplace website. Open it now?\n\n2. **If user confirms, run:**\n\n```bash\n# Open YY marketplace homepage\nopen \"https://mall.yy.com/?pageId=20000\"\n```\n\nIf the user was interested in a specific item, open its detail page instead:\n```bash\nopen \"https://mall.yy.com/?pageId=20000#/shop/detail/{goodsId}\"\n```\n\n---\n\n## Error Handling\n\n| Situation | Response |\n|-----------|----------|\n| API request fails / timeout | \"Query failed. Visit https://mall.yy.com/?pageId=20000 directly.\" |\n| Game has no such sub-category | \"This game doesn't have that category. Available: [list sub-categories]\" |\n| Empty goods list | \"No listings found for this selection.\" |\n| Ambiguous game name | List similar game names and ask user to confirm |\n\n---\n\n## Out of Scope\n\n- Login / authentication (not needed for queries)\n- Placing orders or payments (redirect to website instead)\n- Price sorting / filtering (future iteration)\n- Favorites / comparison\n\n---\n\n## Examples\n\n```\nUser: show me 王者荣耀 accounts\n→ Queries categoryId=5, subCategoryId=5, displays 20 listings\n\nUser: I want to look at boosting services\n→ Game unclear → shows game list for selection\n\nUser: next page\n→ Increments to page 2, same category\n\nUser: open item 3\n→ Opens https://mall.yy.com/?pageId=20000#/shop/detail/{goodsId}\n\nUser: I want to buy this\n→ \"To buy, you'll need the YY website. Open it now?\"\n→ Confirmed → open \"https://mall.yy.com/?pageId=20000#/shop/detail/{goodsId}\"\n\nUser: I want to sell my account\n→ \"To sell, you'll need the YY website. Open it now?\"\n→ Confirmed → open \"https://mall.yy.com/?pageId=20000\"\n```\n\n---\n\n## API Reference\n\n| Field | Value |\n|-------|-------|\n| Base URL | `https://gamemarket.yy.com` |\n| Categories endpoint | `GET /category/queryShowCategories?sid=&hdid={HDID}` |\n| Listings endpoint | `GET /goods/v2/search` |\n| Signature | `MD5(\"appId={APPID}&nonce={nonce}&timestamp={ts}&uri={uri}&secret={SECRET}\")` |\n| APPID | `market_app` |\n| SECRET | `ixlOJVDwdOm5rGdudhEywwK6` |\n| HDID | `38e6a82f5f724517d6cbe82cde56e846690afcb0` |\n| Detail URL pattern | `https://mall.yy.com/?pageId=20000#/shop/detail/{goodsId}` |\n| Buy/Sell URL | `https://mall.yy.com/?pageId=20000` |\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":375,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778031765244,"updatedAt":1779680704193},"latestVersion":{"version":"1.0.0","createdAt":1778031765244,"changelog":"- Initial release of the Game Market skill.\n- Lets users browse and search YY game trading marketplace listings by game and category.\n- Supports popular games and trading types (accounts, boosting, coaching, items, currency).\n- Interactive chat flow guides users through selecting game and category, viewing listings, and paginating.\n- Provides direct links to items or marketplace homepage for buy/sell actions.\n- No login required for browsing; purchases and sales redirect to the YY website.","license":"MIT-0"},"metadata":null,"owner":{"handle":"arc-lin","userId":"s1752w8m81c40svhsne89wyr31867qwj","displayName":"Arclin","image":"https://avatars.githubusercontent.com/u/12107804?v=4"},"moderation":null}