Documentatie

    API Authentication

    All API requests require a valid API key passed as a Bearer token in the Authorization header. API keys are scoped to your user account and can be created, rotated, and revoked from Settings.

    What It Is

    API authentication uses Bearer token authentication with API keys. Each key is prefixed with sg_live_ (production) or sg_test_ (development) and grants access based on assigned scopes.

    How It Works

    1. Create an API key in Settings > API Keys
    2. Copy the key immediately (it's only shown once)
    3. Add the Authorization header to every request:
    4. ``

      Authorization: Bearer sg_live_abc123def456...

      `

      Request Example

      `bash

      curl

      curl -X GET "https://seogeo.tools/api/public/v1/me" \

      -H "Authorization: Bearer sg_live_abc123def456"

      ` `javascript

      // JavaScript (fetch)

      const response = await fetch("https://seogeo.tools/api/public/v1/me", {

      headers: {

      "Authorization": "Bearer sg_live_abc123def456"

      }

      });

      const data = await response.json();

      ` `python

      Python (requests)

      import requests

      response = requests.get(

      "https://seogeo.tools/api/public/v1/me",

      headers={"Authorization": "Bearer sg_live_abc123def456"}

      )

      data = response.json()

      `

      Response Example

      `json

      {

      "data": {

      "userId": "550e8400-e29b-41d4-a716-446655440000",

      "email": "user@example.com",

      "plan": "pro",

      "apiKeyPrefix": "sg_live_"

      },

      "meta": {

      "requestId": "req_abc123"

      }

      }

      ``

      API Key Scopes

      Keys can be limited to specific operations:

      ScopePermissions
      projects:readList and view projects
      projects:writeCreate projects
      audits:readList audits and pages
      audits:writeStart new audits
      content:readList content drafts
      content:writeCreate content briefs
      reports:readList report snapshots
      geo:readView GEO monitor data
      geo:writeStart GEO tests

      API Key Limits by Plan

      PlanMax Active Keys
      Starter2
      Pro10
      Agency50

      Common Errors

      Error CodeMeaning
      UNAUTHORIZEDMissing or invalid API key
      FORBIDDENAPI key lacks required scope

      Security Best Practices

      • Never commit API keys to version control
      • Use environment variables to store keys
      • Rotate keys regularly
      • Use minimum required scopes
      • Revoke unused keys promptly
    Was deze pagina nuttig?

    Laatst bijgewerkt: 20-1-2025