GraphQL API

Enterprise planGraphQL needs an Enterprise plan.

POST /v1/graphql answers the same reads as the REST endpoints in one request, with only the fields you ask for. Card fields use the REST names and follow the same plan rules.

Endpoint

POST /v1/graphql: Run a GraphQL query Enterprise plan

One endpoint for every read, as GraphQL: send a JSON body {"query": "..."}. Root fields: cards, card, searchCards, bestCards, issuers, issuer, categories, stats, transferPartners and applicationRules. Card fields use the REST names (annual_fee, reward_rates) and follow the same plan rules. A query may ask for at most 10 root fields (aliases included) and nest 5 levels deep; list fields return at most 100 items; schema introspection is off.

Parameters
querystringrequiredThe GraphQL query document
Response (abridged)
{
  "data": {
    "card": {
      "slug": "american-express-gold-card",
      "name": "American Express® Gold Card",
      "annual_fee": 325,
      "reward_rates": [
        { "category_slug": "dining", "rate_multiplier": 4 },
        { "category_slug": "groceries", "rate_multiplier": 4 }
      ]
    }
  }
}

Send a query

curl -X POST "https://api.cardapi.dev/v1/graphql" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ card(slug: \"american-express-gold-card\") { slug name annual_fee reward_rates { category_slug rate_multiplier } } }"}'

Root fields

  • cards(country, issuer, network, limit, offset)

    Published cards, like GET /v1/cards.

  • card(slug)

    One card, like GET /v1/cards/:slug.

  • searchCards(query, limit, offset)

    Card and issuer name search, like GET /v1/cards/search.

  • bestCards(category, country, maxAnnualFee, includeRestricted)

    Cards ranked for one category, with category_rate, like GET /v1/cards/best.

  • issuers(country) / issuer(slug)

    Issuers with card counts.

  • categories

    The spending categories.

  • stats

    Card and issuer counts.

  • transferPartners(currency)

    The transfer partner directory.

  • applicationRules(issuer)

    Issuer application rules.

Limits

A query may ask for at most 10 root fields (aliases included) and nest at most 5 levels deep. List fields return at most 100 items. Schema introspection is off, so use this page and the card object reference for field names.

Related

Re-checked against issuer sites every Friday · last change Oct 17