> ## Documentation Index
> Fetch the complete documentation index at: https://api.globalwebindex.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Spark API v2 endpoints and how they fit together

Spark API v2 gives programmatic access to GWI audience insights through a set of REST endpoints under **`/v2/spark-api/`**. Each endpoint does one job: list datasets, resolve location and timeframe filters, find or create audiences, generate insights, and return the details behind an insight. You chain them to answer a question, and reuse the IDs they return across calls.

The v2 endpoints run the same logic as the [Spark MCP v2](https://api.globalwebindex.com/docs/spark-mcp/v2/overview.md) tools, so results match what AI assistants get from Spark MCP.

## **Endpoints**

| Endpoint | What it does |
| :- | :- |
| `GET /v2/spark-api/datasets` | Lists the datasets available to your account, as a tree of folders and datasets |
| `POST /v2/spark-api/datasets/explore` | Describes up to five datasets |
| `POST /v2/spark-api/global-filters` | Resolves the locations and timeframes in a prompt into `location_codes` and `wave_codes` |
| `POST /v2/spark-api/audiences/search` | Searches the platform audiences available to your account |
| `POST /v2/spark-api/audiences/generate` | Creates or matches audiences from natural-language descriptions |
| `POST /v2/spark-api/audiences/join` | Combines two or more audiences into an intersection or a union |
| `POST /v2/spark-api/insights/generate` | Generates insights for up to ten prompts in one request |
| `GET /v2/spark-api/insights/{id}` | Returns an insight with its sources and the statistics for each answer |
| `POST /v2/spark-api/taxonomy/explore` | Finds the survey questions and attributes that match a topic |
| `GET /v2/spark-api/skills` | Lists workflow skills for AI assistants that use this API |
| `GET /v2/spark-api/skills/{key}` | Returns the full instructions of a workflow skill |

Start with [Prerequisites](https://api.globalwebindex.com/docs/spark-api/v2/getting-started/prerequisites.md), then follow the [Quickstart](https://api.globalwebindex.com/docs/spark-api/v2/getting-started/authorization.md) for how to chain them, with a request and response example for each endpoint.

## **Authorization**

Send your API token in the `Authorization` header of every request, in the form `Authorization: Bearer YOUR_API_KEY`. v2 uses the same token as v1. See [Authorization](https://api.globalwebindex.com/docs/spark-api/getting-started/authorization.md).

## **Requests**

* Request bodies are JSON objects. Required fields must be present, values must have the documented type, and fields that are not documented are rejected.
* The maximum request body size is 4 MiB.
* The full request and response schemas are in the [API reference](https://api.globalwebindex.com/docs/spark-api/v2/reference/datasets/list-datasets.md), which is built from the v2 OpenAPI 3.1 spec.

## **Errors**

Errors are returned as [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem details with `Content-Type: application/problem+json`. Each problem `type` URI links to a page that explains the error. See [Errors](https://api.globalwebindex.com/docs/spark-api/v2/getting-started/errors.md).

## **Moving from v1**

Your v1 integration keeps working. See the [Transition guide](https://api.globalwebindex.com/docs/spark-api/v2/getting-started/transition-guide.md) for the endpoint mapping and the changes to plan for.
