Make your first API call

Authenticate against the AskThis REST API and pull your first analytics in a couple of minutes.

The AskThis REST API lets you pull analytics, manage sites, and work with prompts programmatically. It’s available on Pro plans and above (write access at scale is Enterprise). Base URL: https://api.askthis.io.

1. Create an API key

In the dashboard, go to Settings → API keys and create a key. Copy it — it’s shown once, at creation. Keys are bearer tokens prefixed ak_.

2. Authenticate

Send the key as a bearer token:

curl https://api.askthis.io/api/v1/sites \
  -H "Authorization: Bearer ak_xxxxxxxxxxxx"

3. Your first request

Pull 30 days of AI-click analytics for a site (swap in your site ID):

curl "https://api.askthis.io/api/v1/analytics/cq_8f2a/ai?days=30" \
  -H "Authorization: Bearer ak_xxxxxxxxxxxx"

Every response uses the same envelope — data under data, a requestId under meta:

{
  "data": {
    "totals": { "aiClicks": 967, "days": 30 },
    "series": [{ "date": "2026-06-01", "value": 31 }],
    "byPlatform": [{ "platform": "chatgpt", "value": 402 }]
  },
  "error": null,
  "meta": { "requestId": "req_..." }
}

Swap ai for social or questions to pull other segments.

Core endpoints

Endpoint Purpose
GET /api/v1/sites List sites and install status
GET /api/v1/sites/:id Site detail + widget configuration
GET /api/v1/analytics/:siteId/ai?days=30 AI-click analytics (also /social, /questions)
GET /api/v1/analytics/:siteId/pages Per-page performance
GET /api/v1/prompts/:siteId Generated prompt templates for a site
PUT /api/v1/sites/:id/config Update widget configuration

Rate limits & errors

Rate-limited endpoints return X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers, plus a 429 with Retry-After when exceeded. The full reference lives in the developer docs: API quickstart and errors & rate limits.

Next steps

Was this helpful?

Last updated July 26, 2026 · Edit this page ↗