# GraphQL API

GrackerAI's visibility data - responses, mentions, citations, scores, and aggregates - is queryable through **GraphQL**. There's no separate public API for direct developer or `curl` access: the GraphQL layer is reached through [MCP](/docs/advanced/mcp), inside an MCP-connected AI assistant like ChatGPT, Claude, or Cursor.

---

## How it works

- **Read-only**: queries only, no mutations or subscriptions. Nothing in your workspace can be changed through it.
- **Brand-scoped**: every result is automatically limited to the brands you selected when you connected. A query can't widen its own scope.
- **Self-describing**: the schema is introspectable, so an AI assistant can look up the available types and fields before it writes a query.

---

## Accessing it

You don't request a token or write `curl` commands against a GrackerAI endpoint. Instead, you connect an MCP client to your GrackerAI account (a standard OAuth sign-in, done once per client), and the client gets two tools:

- **`get_visibility_schema`** - introspects the schema
- **`query_visibility_data`** - runs a read-only query and returns the result

The AI assistant handles writing and running the GraphQL queries for you - you ask questions in natural language. See [MCP](/docs/advanced/mcp) for how to connect a client and how the connection is authenticated.

---

## What the data looks like

The schema covers visibility rows (one per prompt, engine, country, and run), brand mentions, citations, competitors, co-occurring brands, prompts, and personas, plus aggregates over them. For example, a query run through `query_visibility_data` might look like:

```graphql
query {
  visibility(limit: 10) {
    promptId
    providerKey
    country
    visibilityScore
    presence
    brandMentionCount
    competitorMentionCount
  }
  citation(limit: 10) {
    url
    domain
    sourceType
    isBrandDomain
    supportsClaim
  }
}
```

This is a sketch, not a reference - your AI assistant introspects the live schema for the exact types, fields, and filters before it writes a query.

---

## Errors

- Malformed input, or any operation that isn't a read query, is rejected before it runs.
- A response containing an `errors` array means the query was understood but something failed (for example an unknown field) - your assistant can re-introspect the schema and retry.

---

## Availability & limits

Access is through MCP and is subject to a **monthly request limit set by your plan**. Workspaces without an active plan or trial can't use it. Only `query_visibility_data` calls count against the limit; schema introspection doesn't. You can see how many you've used under **MCP Requests** on the workspace **Usage** page. See [Plans & Pricing](/docs/getting-started/billing) for plan details.

---

## Next Steps

- [MCP](/docs/advanced/mcp): Query your data from an AI assistant
- [Reporting & Exports](/docs/using-gracker/reporting): Export prompts, responses, and analytics

- [Integrations](/docs/integrations/integration-overview): Connect Search Console, Bing, WordPress, and more
