Quick start
In about five minutes you will authenticate, find a project, run a keyword research tool through the API and read the keywords it saved. Every step shows the plain HTTP request in curl, PHP and JavaScript.
Before you start
- A SemanticsOn account on a plan that includes API access (check pricing).
- At least one project. Create one in the dashboard under Projects if you have none.
- A terminal with
curl, a PHP environment, or Node.js 18+ (forfetch).
Pick a language once; every code sample on the site follows your choice.
Create an API key
In the dashboard open API Settings and choose Create API key under SemanticsOn API keys. Name it after where it will run (for example “Local test”) and give it at least
projects:read,content:readandtools:run. Copy the key: it is shown only once.Keep it out of your code by storing it in an environment variable:
Terminal export SEMANTICSON_API_KEY="so_live_…"In WordPress, define it in
wp-config.phpinstead:define( 'SEMANTICSON_API_KEY', 'so_live_…' );Make your first request
GET /mereturns the account, key, plan and usage. It needs no scope, so it is the best way to check a key.GET /mecurl https://semanticson.com/api/v1/me \ -H "Authorization: Bearer $SEMANTICSON_API_KEY"200 OK (abridged) { "object": "account", "user": { "id": "cm8usr…", "name": "Ada Lovelace", "email": "ada@example.com" }, "key": { "id": "cm8key…", "name": "Local test", "kind": "user", "scopes": [ "projects:read", "content:read", "tools:run" ] }, "site": null, "plan": { "name": "Pro", "slug": "pro", "limits": { "apiRequestsPerMonth": "…", "connectedSites": "…" } }, "usage": { "apiRequestsThisPeriod": 1, "toolRunsToday": 0 } }A
401means the header is missing or the key is wrong; a403 api_access_not_in_planmeans the plan does not include API access. See errors.List your projects
GET /projectscurl https://semanticson.com/api/v1/projects \ -H "Authorization: Bearer $SEMANTICSON_API_KEY"The response is a list. Note the
idof the project you want to work in; the next steps call itPROJECT_ID.200 OK (abridged) { "object": "list", "data": [ { "object": "project", "id": "PROJECT_ID", "name": "Espresso Lab", "domain": "example.com", "language": "en", "status": "active" } ], "hasMore": false, "nextCursor": null }Run a tool
Tools are run by slug with the same inputs as the dashboard form.
GET /toolslists every tool, itsfieldsand whether your plan includes it. Here we run AI Keyword Research (ai-keyword-research) and save the results to the project:POST /tools/ai-keyword-research/runcurl -X POST https://semanticson.com/api/v1/tools/ai-keyword-research/run \ -H "Authorization: Bearer $SEMANTICSON_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": { "seed": "espresso machine", "count": "40", "focus": "balanced" }, "projectId": "PROJECT_ID" }'The API answers
202 Acceptedstraight away with anexecutionwhose status isqueued. Keep itsid.202 Accepted (abridged) { "object": "execution", "id": "EXECUTION_ID", "tool": "ai-keyword-research", "projectId": "PROJECT_ID", "status": "queued", "progress": null, "error": null, "result": null }Runs use your plan's run limits and AI allowance exactly like the dashboard. If you added your own AI provider key in API Settings, it is used here too.
Wait for the result
Poll
GET /executions/{executionId}every few seconds untilstatusissucceededorfailed. Most runs take from a few seconds to a couple of minutes.Poll the execution# Repeat every few seconds until "status" is "succeeded" (or "failed") curl https://semanticson.com/api/v1/executions/EXECUTION_ID \ -H "Authorization: Bearer $SEMANTICSON_API_KEY"The finished execution includes
result(a summary, typed result blocks and data sources). Prefer push over polling in production: subscribe to thetool.completedandtool.failedwebhooks.Read the keywords
Because the run had a
projectId, its keywords were saved to the project. Read them page by page:GET /projects/{projectId}/keywordscurl https://semanticson.com/api/v1/projects/PROJECT_ID/keywords?limit=100 \ -H "Authorization: Bearer $SEMANTICSON_API_KEY"200 OK (abridged) { "object": "list", "data": [ { "object": "keyword", "id": "cm8kw…", "phrase": "espresso machine for beginners", "intent": "commercial", "clusterId": null, "volume": null, "cpc": null, "competition": null, "metricSource": "none", "aiCompetitionEstimate": "medium" } ], "hasMore": true, "nextCursor": "cm8kw…" }Metrics are never invented
volume,cpcandcompetitionare only set when they come from a connected keyword data provider or your own import (metricSource). Otherwise they arenull, andaiCompetitionEstimateholds a qualitative AI judgement.
Next steps
- Authentication: scopes, presets and site keys.
- Webhooks: get notified instead of polling.
- Connected sites: sync a website and propose changes that a person approves.
- API reference: every endpoint with parameters and examples.