Global Trade Alert
Global Trade Alert
API Access

GTA API Quickstart

Get a key, run one request, and see a real response in about five minutes. Every example in this quickstart is a complete request you can copy as curl or Python, shown with the live result it returned.

Updated 2026-07-12

Your first call in five minutes

  1. Get a key. Request a demo key at globaltradealert.org/api-access: self-serve, no sales call required.

  2. Set the key as an environment variable. Never paste it into source code.

    macOS / Linux:

    bash
    export GTA_API_KEY="paste-your-key-here"

    Windows (PowerShell):

    powershell
    $env:GTA_API_KEY = "paste-your-key-here"
  3. Run one request (macOS/Linux shown; on Windows, run it from Git Bash or WSL, or use the Python version below):

    curl -s -X POST https://api.globaltradealert.org/api/v2/gta/data/ \
      -H "Content-Type: application/json" \
      -H "Authorization: APIKey $GTA_API_KEY" \
      -d '{"request_data": {"gta_evaluation": [1]}, "limit": 1, "offset": 0}'
    import os
    
    import requests
    
    API_KEY = os.environ["GTA_API_KEY"]
    
    response = requests.post(
        "https://api.globaltradealert.org/api/v2/gta/data/",
        headers={"Authorization": f"APIKey {API_KEY}"},
        json={"request_data": {"gta_evaluation": [1]}, "limit": 1, "offset": 0},
    )
    response.raise_for_status()
    records = response.json()
    
  4. What success looks like: HTTP 200 and a JSON array containing one intervention record. An empty array [] is also a success; it means no records matched your filters, not that the call failed.

One base URL, one auth header, two request conventions

  • Base URL: https://api.globaltradealert.org. Every endpoint in this quickstart is a path under this host.
  • Authentication: send Authorization: APIKey <your-key>, exactly that header form, on every endpoint, GTA and TAU alike. A bare APIKey: <your-key> header returns 401 Unauthorized on both product surfaces.
  • GTA family: POST with a JSON body, bare-array responses. The five GTA data endpoints (mappings, data, ticker, impact chains) are POST requests: filters live inside a request_data object, limit/offset are siblings of it, and every response is a bare JSON array of result objects: no wrapper, no count field. To know whether you have retrieved everything, keep incrementing offset by limit until a call returns fewer rows than requested.
  • TAU family: GET with query parameters. The US tariff endpoints are GET requests with query-string parameters instead of a JSON body; their page opens with the full convention.
  • Build on V2: use /api/v2/gta/data/ for GTA data queries. The legacy /api/v1/data/ still answers today but has been dropped from GTA's published OpenAPI schema, and is no longer actively maintained.

Looking for digital-policy events rather than trade measures? Digital Policy Alert (DPA) is a separate SGEPT product line with its own event data, not covered by this quickstart; contact us for API access details.

If the first call fails

SymptomLikely causeFix
401 UnauthorizedWrong header form or bad keyThe header must read Authorization: APIKey <key>; check for a missing Authorization: prefix, a stray space, or an inactive key
400 Bad RequestMalformed JSON bodyValidate the JSON (a trailing comma is the usual culprit); on Windows cmd.exe the quoting rules differ; use PowerShell, Git Bash, or put the body in a file and pass -d @body.json
[] empty arrayFilters matched nothingThe call succeeded; widen the date range or resolve ids via the mappings endpoint first
Shell error mid-commandLine continuation broke on pasteThe trailing \ must be the last character on each line; re-copy the block or join the command onto one line

The same call in Python

Every request in this quickstart is shown as curl, and every code block on the endpoint pages carries a generated Python tab beside it. If you are integrating in Python, the same auth header and envelope apply directly to requests:

python
import os

import requests

API_KEY = os.environ["GTA_API_KEY"]

response = requests.post(
    "https://api.globaltradealert.org/api/v2/gta/data/",
    headers={"Authorization": f"APIKey {API_KEY}"},
    json={"request_data": {"gta_evaluation": [1]}, "limit": 1, "offset": 0},
)
response.raise_for_status()
records = response.json()
print(f"{len(records)} record(s): {records[0]['state_act_title']}")

Executed live 2026-07-11; output: 1 record(s): Bolivia: Expropriation of Chaco Petroleum.

Worked examples for every endpoint

Each page states the business question an endpoint answers, prints the full request, explains every parameter against the live schema, and reads the result.

For agents and LLMs: this page as markdown, llms.txt index, OpenAPI schema.