Skip to content

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+ (for fetch).

Pick a language once; every code sample on the site follows your choice.

  1. 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:read and tools: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.php instead: define( 'SEMANTICSON_API_KEY', 'so_live_…' );

  2. Make your first request

    GET /me returns the account, key, plan and usage. It needs no scope, so it is the best way to check a key.

    curl 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 401 means the header is missing or the key is wrong; a 403 api_access_not_in_plan means the plan does not include API access. See errors.

  3. List your projects

    curl https://semanticson.com/api/v1/projects \
      -H "Authorization: Bearer $SEMANTICSON_API_KEY"

    The response is a list. Note the id of the project you want to work in; the next steps call it PROJECT_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
    }
  4. Run a tool

    Tools are run by slug with the same inputs as the dashboard form. GET /tools lists every tool, its fields and whether your plan includes it. Here we run AI Keyword Research (ai-keyword-research) and save the results to the project:

    curl -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 Accepted straight away with an execution whose status is queued. Keep its id.

    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.

  5. Wait for the result

    Poll GET /executions/{executionId} every few seconds until status is succeeded or failed. Most runs take from a few seconds to a couple of minutes.

    # 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 the tool.completed and tool.failed webhooks.

  6. Read the keywords

    Because the run had a projectId, its keywords were saved to the project. Read them page by page:

    curl 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, cpc and competition are only set when they come from a connected keyword data provider or your own import (metricSource). Otherwise they are null, and aiCompetitionEstimate holds a qualitative AI judgement.

Next steps