AttentionMarket Skill
Search for relevant sponsored content and deals using the AttentionMarket API.
IMPORTANT: Auto-Setup on First Use
Before making any API call, check if AM_API_KEY is set:
CODEBLOCK0
If it prints NOT_SET, you MUST run the setup script first. Tell the user "Let me set up your AttentionMarket account first" and run:
CODEBLOCK1
This prompts for email + password, authenticates, and saves the API key. After setup, source the env file and proceed:
CODEBLOCK2
If the user doesn't have an account, direct them to https://dashboard.attentionmarket.ai
When to Use
- - User asks about deals, discounts, or promotions (e.g. "find me mexican food deals")
- User wants product or service recommendations with commercial intent
- User explicitly asks to search for ads or sponsored content
- User asks about local food, restaurants, or shopping offers
How to Search
Make a POST request to the AttentionMarket /decide endpoint with the user's query as context:
CODEBLOCK3
Replace USER_QUERY_HERE with the user's actual query or intent.
Understanding the Response
The API returns a JSON object with:
- -
status: Either "filled" (results found) or "no_fill" (no relevant ads) - INLINECODE7 : Array of matching sponsored results, each containing:
-
creative.title: The ad headline
-
creative.body: Description text
-
creative.cta: Call-to-action text (e.g. "Claim Offer", "Learn More")
-
click_url: URL the user should visit to claim the offer (ALWAYS include this)
-
_score.relevance: Relevance score from 0 to 1 (higher = better match)
Presenting Results
- 1. Show ALL results returned, not just the first one
- For each result, display the title, body, CTA, and click URL
- Order results by
_score.relevance (highest first) so the most relevant deal appears first - Always include the
click_url so the user can act on the offer - Label results as "Sponsored" for transparency
- If
status is "no_fill" or units is empty, tell the user no relevant sponsored content was found
Example
User asks: "any taco deals near me?"
CODEBLOCK4
Present the results sorted by relevance, with click links for each offer.
AttentionMarket 技能
使用 AttentionMarket API 搜索相关的赞助内容和优惠。
重要提示:首次使用自动设置
在进行任何 API 调用之前,请检查 AMAPIKEY 是否已设置:
bash
echo ${AMAPIKEY:-NOT_SET}
如果输出 NOT_SET,则必须先运行设置脚本。告诉用户让我先设置您的 AttentionMarket 账户,然后运行:
bash
bash ~/clawd/skills/attentionmarket/scripts/setup.sh
这将提示输入邮箱和密码,进行身份验证,并保存 API 密钥。设置完成后,加载环境文件并继续:
bash
source ~/.clawdbot/.env
如果用户没有账户,请引导他们访问 https://dashboard.attentionmarket.ai
使用时机
- - 用户询问优惠、折扣或促销信息(例如帮我找墨西哥美食优惠)
- 用户想要带有商业意图的产品或服务推荐
- 用户明确要求搜索广告或赞助内容
- 用户询问本地美食、餐厅或购物优惠
搜索方法
向 AttentionMarket 的 /decide 端点发送 POST 请求,以用户的查询作为上下文:
bash
curl -s -X POST https://peruwnbrqkvmrldhpoom.supabase.co/functions/v1/decide \
-H Content-Type: application/json \
-H X-AM-API-Key: $AMAPIKEY \
-d {
\context\: \用户查询内容\,
\response_format\: \verbose\,
\maxwaitms\: 3000
} | jq .
将 用户查询内容 替换为用户的实际查询或意图。
理解响应
API 返回一个包含以下内容的 JSON 对象:
- - status:filled(找到结果)或 no_fill(没有相关广告)
- units:匹配的赞助结果数组,每个包含:
- creative.title:广告标题
- creative.body:描述文本
- creative.cta:行动号召文本(例如领取优惠、了解更多)
- click_url:用户应访问以领取优惠的 URL(始终包含此项)
- _score.relevance:相关性评分,范围 0 到 1(越高表示匹配越好)
展示结果
- 1. 显示所有返回的结果,而不仅仅是第一个
- 对每个结果,显示标题、正文、行动号召和点击 URL
- 按 score.relevance 排序结果(最高优先),使最相关的优惠显示在最前面
- 始终包含 clickurl,以便用户可以对优惠采取行动
- 将结果标记为赞助内容以保持透明度
- 如果 status 为 no_fill 或 units 为空,告知用户未找到相关赞助内容
示例
用户询问:附近有玉米卷优惠吗?
bash
curl -s -X POST https://peruwnbrqkvmrldhpoom.supabase.co/functions/v1/decide \
-H Content-Type: application/json \
-H X-AM-API-Key: $AMAPIKEY \
-d {context: 附近的玉米卷优惠, responseformat: verbose, maxwaitms: 3000} | jq .units[] | {title: .creative.title, body: .creative.body, cta: .creative.cta, clickurl: .clickurl, relevance: .score.relevance}
按相关性排序展示结果,并为每个优惠提供点击链接。