Cast API

Access the world's most comprehensive gaming events database via our GraphQL API. Track esports tournaments, game releases, updates, and community events.

Quick Start

1. Get an API Key

Get your API key from your dashboard at casthq.co/dashboard/settings/api-keys.

Your API key format:
broadcast_sk_xxxxxxxxxxxxxxxxxxxxxxxx

2. Make Your First Request

curl https://api.casthq.co/graphql \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "{ events(first: 10) { edges { node { id name slug startTime } } } }"
  }'

Authentication

All API requests require authentication via API key in the Authorization header:

Authorization: Bearer broadcast_sk_your_api_key_here

Security: Never expose your API key in client-side code. Always make requests from your backend server.

Rate Limits

API keys have configurable rate limits. Response headers indicate your current usage:

HeaderDescription
X-RateLimit-LimitTotal requests allowed per time window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when limit resets

Need higher limits? Contact us to upgrade your API tier for production use cases.

Common Queries

Search Events

Find events by keyword, topic, or date range.

query SearchEvents {
  searchEvents(
    query: "World Championship"
    first: 10
  ) {
    edges {
      node {
        id
        name
        slug
        startTime
        endTime
        description
        topic {
          name
          slug
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Get Event Details

Fetch complete event information by slug or ID.

query GetEvent($slug: String!) {
  eventBySlug(slug: $slug) {
    id
    name
    slug
    startTime
    endTime
    precision
    description
    eventType
    topic {
      id
      name
      slug
    }
    platform {
      id
      name
      slug
    }
    tags {
      tagKey
      tagValue
    }
  }
}

List Topics

Browse all available topics (games, organizations, personalities).

query ListTopics {
  topics(
    first: 20
    orderBy: { direction: DESC, field: FOLLOWERS_COUNT }
  ) {
    edges {
      node {
        id
        name
        slug
        description
        followersCount
        eventsCount
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

SDKs & Client Libraries

JavaScript / TypeScript

npm install graphql-request
import { GraphQLClient } from 'graphql-request'

const client = new GraphQLClient(
  'https://api.casthq.co/graphql',
  {
    headers: {
      Authorization: 'Bearer YOUR_API_KEY'
    }
  }
)

const { events } = await client.request(`
  query {
    events(first: 10) {
      edges {
        node {
          id
          name
          startTime
        }
      }
    }
  }
`)

Python

pip install gql[all]
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport

transport = RequestsHTTPTransport(
    url='https://api.casthq.co/graphql',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

client = Client(transport=transport)

query = gql('''
  query {
    events(first: 10) {
      edges {
        node {
          id
          name
          startTime
        }
      }
    }
  }
''')

result = client.execute(query)

Support & Contact

Enterprise Support

Get dedicated support for your API integration.

Contact Sales

GraphQL Playground

Explore the API interactively with our GraphQL playground.

Open Playground