← 返回
内容创作 中文

scryfall-cards

Search and retrieve Magic: The Gathering card data using the Scryfall API. Use this skill when the user asks about MTG cards, wants to search for cards by name, type, color, mana cost, oracle text, set, or any other card attribute. Also use for getting card images, prices, rulings, legality information, or random cards. Triggers include mentions of MTG, Magic, Magic: The Gathering, card names, deck building questions, or requests for card information.
使用Scryfall API搜索和检索万智牌卡牌数据。当用户询问MTG卡牌,或根据名称、类型、颜色、法术力费用、规则叙述、系列等属性搜索卡牌时使用。亦用于获取卡牌图片、价格、规则解释、合法性与随机卡牌。触发词包括MTG、万智牌、卡牌名称、套牌构建问题或卡牌信息查询。
santidev95
内容创作 clawhub v1.0.0 1 版本 99827.6 Key: 无需
★ 1
Stars
📥 1,717
下载
💾 83
安装
1
版本
#latest

概述

Scryfall MTG Card Search

Search for Magic: The Gathering cards using the Scryfall API.

API Overview

Base URL: https://api.scryfall.com

Required Headers:

headers = {
    "User-Agent": "OpenClawMTGSkill/1.0",
    "Accept": "application/json"
}

Rate Limiting: Insert 50-100ms delay between requests (max 10 req/sec).

Core Endpoints

Search Cards

GET /cards/search?q={query}

Parameters:

  • q (required): Fulltext search query
  • unique: cards|art|prints (default: cards)
  • order: name|set|released|rarity|color|usd|tix|eur|cmc|power|toughness|edhrec|penny|artist|review
  • dir: auto|asc|desc
  • page: Page number for pagination

Named Card Lookup

GET /cards/named?exact={name}
GET /cards/named?fuzzy={name}

Use fuzzy for partial matches (e.g., "jac bele" → "Jace Beleren").

Add &set={code} to limit to specific set.

Random Card

GET /cards/random
GET /cards/random?q={query}

Card by ID

GET /cards/{id}
GET /cards/{set_code}/{collector_number}

Autocomplete

GET /cards/autocomplete?q={partial_name}

Returns up to 20 card name suggestions.

Search Syntax Reference

See references/search_syntax.md for the complete search syntax guide.

Quick examples:

  • c:red pow=3 - Red cards with power 3
  • t:merfolk t:legend - Legendary merfolk
  • o:"draw a card" - Cards with "draw a card" in text
  • cmc=3 r:rare - 3-mana rares
  • e:dom - Cards from Dominaria
  • f:standard - Standard legal cards
  • usd<1 - Cards under $1

Implementation

Use the provided script for common operations:

python3 scripts/scryfall_search.py search "lightning bolt"
python3 scripts/scryfall_search.py named --exact "Black Lotus"
python3 scripts/scryfall_search.py random
python3 scripts/scryfall_search.py random --query "t:dragon"

Or make direct API calls with proper headers and rate limiting.

Card Object Key Fields

When displaying card info, prioritize these fields:

  • name, mana_cost, type_line
  • oracle_text, power, toughness
  • image_uris.normal (for card image)
  • prices.usd, prices.usd_foil
  • legalities (format legality)
  • set_name, rarity

For double-faced cards, check card_faces array.

Error Handling

  • 404: Card not found
  • 422: Invalid search query
  • 429: Rate limited (wait and retry)

Always validate responses have object field; if object: "error", check details for message.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 19:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,068
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,199
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,487