v2.0.0
OpenAPI 3.2.0

Keyword.com AI Visibility API v2

Read the AI Visibility data of a domain: prompts, answers, brands, citations, sources and sentiment. Add, edit and run the prompts and topics of a domain.

Authentication

Send your API token as a bearer token. Authorization: Bearer YOUR_API_TOKEN.

Access

The routes need an AI Visibility add-on and a role that can view AI Visibility. The write routes also need a role that can edit projects.

Filters

Send a preset timeframe or a from and to. The previous values cover the window before, of the same length, or the window you name with compare_from and compare_to. Send a list as a repeated parameter, for example engines[]=chatgpt_gui&engines[]=claude_haiku_api.

Rate limits

Each data route allows 120 requests in 60 seconds. Estimate a prompt run allows 30, and Run prompts allows 10. Above the limit, the API returns 429.

Every response is {"data": ...}. Some routes add meta.

Server:https://app.keyword.com
Client Libraries

AI Visibility

​

Get project domain

​

Use this call to find the AI Visibility domain of a project.

Important Notes:

  1. Use the domain_id in the domain routes.

  2. domain_id is null when the project has no domain in AI Visibility.

  3. A group gives a 422. Use the parent project.

Path Parameters

  • Project ID

Responses

  • Get project domain.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/projects/{project_id}/ai-visibility
curl https://app.keyword.com/api/v2/projects/1234/ai-visibility \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "domain_id": null,
    "domain": null
  }
}

List filter options

​

Use this call to get the values you can send in the filters of the other routes.

Path Parameters

  • AI Visibility domain ID

Responses

  • List filter options.

    • Properties: 5
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/filter-options
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/filter-options \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "topics": [
      {
        "id": 1,
        "name": "string",
        "prompt_count": 1,
        "tags": [
          "string"
        ]
      }
    ],
    "engines": [
      "chatgpt_gui"
    ],
    "tags": [
      "string"
    ],
    "regions": [
      "string"
    ],
    "prompts": [
      {
        "id": 1,
        "prompt": "string",
        "engine": "chatgpt_gui",
        "topic_id": null,
        "region": null,
        "status": "string"
      }
    ]
  }
}

Get overview

​

Use this call to get the metrics of your brand, with series by brand, engine and topic.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Compare these brands. 50 at most. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

Responses

  • Get overview.

    • Properties: 4
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/overview
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/overview?timeframe=30d&aggregation=daily&tag_mode=any&last_run_only=false' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "own_brand": {
      "name": "string",
      "current": {
        "visibility_score": 1,
        "detection_rate": 1,
        "avg_rank": 1,
        "top3_rate": 1,
        "mentions": 1,
        "citations": 1,
        "avg_sentiment": null,
        "executions": 1
      },
      "previous": {
        "visibility_score": 1,
        "detection_rate": 1,
        "avg_rank": 1,
        "top3_rate": 1,
        "mentions": 1,
        "citations": 1,
        "avg_sentiment": null,
        "executions": 1
      }
    },
    "series": {
      "brands": {
        "points": [
          {
            "bucket": "string",
            "brands": [
              {
                "name": "string",
                "is_own": true,
                "visibility_score": 1,
                "detection_rate": 1,
                "avg_rank": 1,
                "top3_rate": 1,
                "mentions": 1,
                "citations": 1,
                "avg_sentiment": null
              }
            ],
            "others": {
              "brand_count": 1,
              "mentions": 1,
              "citations": 1
            }
          }
        ]
      },
      "engines": {
        "points": [
          {
            "bucket": "string",
            "engines": [
              {
                "engine": "chatgpt_gui",
                "visibility_score": 1,
                "detection_rate": 1,
                "avg_rank": 1,
                "top3_rate": 1,
                "mentions": 1,
                "citations": 1,
                "avg_sentiment": null,
                "executions": 1
              }
            ]
          }
        ]
      },
      "topics": {
        "points": [
          {
            "bucket": "string",
            "topics": [
              {
                "topic_id": null,
                "topic_name": null,
                "visibility_score": 1,
                "detection_rate": 1,
                "avg_rank": 1,
                "top3_rate": 1,
                "mentions": 1,
                "citations": 1,
                "avg_sentiment": null,
                "executions": 1
              }
            ]
          }
        ]
      }
    },
    "totals": {
      "engines": [
        {
          "engine": "chatgpt_gui",
          "prompts": 1,
          "current": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          },
          "previous": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          }
        }
      ],
      "topics": [
        {
          "topic_id": null,
          "topic_name": null,
          "prompts": 1,
          "current": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          },
          "previous": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          }
        }
      ]
    }
  }
}

List prompts

​

Use this call to list the prompts of a domain, with the metrics of your brand for each prompt.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Compare these brands. 50 at most. Repeat the parameter.

  • Filter by prompt text

  • Filter by prompt status

  • Filter by schedule. Repeat the parameter.

    values
    hourlydailyweeklymonthlymanual
  • Sort field

    values
    • prompt
    • topic
    • engine
    • status
    • last_executed_at
    • last_found_at
    • updated_at
    • runs
  • Sort order

  • Page number

  • Rows per page

  • Add the prompts that are in no topic to the topics[] filter

Responses

  • List prompts.

    • Properties: 3
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/prompts
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts?timeframe=30d&tag_mode=any&sort=prompt&order=asc&page=1&per_page=50' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "pagination": {
      "page": 1,
      "per_page": 1,
      "total": 1,
      "pages": 1
    },
    "counts": {
      "total": 1,
      "active": 1,
      "inactive": 1,
      "never_run": 1
    },
    "prompts": [
      {
        "id": 1,
        "prompt": "string",
        "topic": {
          "id": 1,
          "name": "string"
        },
        "engine": "chatgpt_gui",
        "region": null,
        "web_search": true,
        "frequency": "string",
        "frequency_every_n": 1,
        "status": "active",
        "engine_paused": true,
        "tags": [
          "string"
        ],
        "branded": true,
        "branded_override": null,
        "last_failed_at": null,
        "last_failure_kind": "engine_unavailable",
        "runs": 1,
        "last_executed_at": null,
        "last_found_at": null,
        "next_scheduled_at": null,
        "updated_at": null,
        "metrics": {
          "d1": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          },
          "d7": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          },
          "d30": {
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "top3_rate": 1,
            "mentions": 1,
            "citations": 1,
            "avg_sentiment": null,
            "executions": 1
          },
          "window": {
            "current": {
              "visibility_score": 1,
              "detection_rate": 1,
              "avg_rank": 1,
              "top3_rate": 1,
              "mentions": 1,
              "citations": 1,
              "avg_sentiment": null,
              "executions": 1
            },
            "previous": {
              "visibility_score": 1,
              "detection_rate": 1,
              "avg_rank": 1,
              "top3_rate": 1,
              "mentions": 1,
              "citations": 1,
              "avg_sentiment": null,
              "executions": 1
            }
          }
        },
        "rank": {
          "latest": null,
          "latest_at": null,
          "d1": null,
          "d7": null,
          "d30": null
        },
        "last_found_sentiment": null,
        "ai_overview_share": null
      }
    ]
  }
}

Get prompt

​

Use this call to get the metrics, brands and series of one prompt.

Important Notes:

  1. This route does not take the topics[], prompts[], tags[], tag_mode and brands[] filters.

Path Parameters

  • AI Visibility domain ID

  • Prompt ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by region code, for example US. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

Responses

  • Get prompt.

    • Properties: 7
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/prompts/{prompt_id}
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts/91011?timeframe=30d&aggregation=daily&last_run_only=false' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "prompt": {
      "id": 1,
      "prompt": "string",
      "topic": {
        "id": 1,
        "name": "string"
      },
      "engine": "chatgpt_gui",
      "region": null,
      "web_search": true,
      "frequency": "string",
      "frequency_every_n": 1,
      "status": "active",
      "engine_paused": true,
      "tags": [
        "string"
      ],
      "branded": true,
      "branded_override": null,
      "last_failed_at": null,
      "last_failure_kind": "engine_unavailable",
      "runs": 1,
      "last_executed_at": null,
      "last_found_at": null,
      "next_scheduled_at": null,
      "updated_at": null
    },
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "own_brand": {
      "current": {
        "visibility_score": 1,
        "detection_rate": 1,
        "avg_rank": 1,
        "top3_rate": 1,
        "mentions": 1,
        "citations": 1,
        "avg_sentiment": null,
        "executions": 1
      },
      "previous": {
        "visibility_score": 1,
        "detection_rate": 1,
        "avg_rank": 1,
        "top3_rate": 1,
        "mentions": 1,
        "citations": 1,
        "avg_sentiment": null,
        "executions": 1
      }
    },
    "brands": [
      {
        "name": "string",
        "is_own": true,
        "executions": 1,
        "mention": "string",
        "mentions": 1,
        "detection_rate": 1,
        "avg_rank": 1,
        "avg_sentiment": null,
        "previous": {
          "mentions": 1,
          "detection_rate": 1,
          "avg_rank": 1
        }
      }
    ],
    "web_grounded_executions": 1,
    "series": {
      "points": [
        {
          "bucket": "string",
          "visibility_score": 1,
          "detection_rate": 1,
          "avg_rank": 1,
          "top3_rate": 1,
          "mentions": 1,
          "citations": 1,
          "avg_sentiment": null,
          "executions": 1
        }
      ],
      "brands": {
        "points": [
          {
            "bucket": "string",
            "brands": [
              {
                "name": "string",
                "is_own": true,
                "avg_rank": 1,
                "detection_rate": 1,
                "mentions": 1
              }
            ]
          }
        ]
      }
    },
    "rank": {
      "latest": null,
      "latest_at": null,
      "d1": null,
      "d7": null,
      "d30": null
    }
  }
}

List executions

​

Use this call to list the executions (answers) of the prompts of a domain, newest first.

Important Notes:

  1. Page with cursor. Send the next_cursor of the last response.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

  • Filter by the presence of your brand in the answer

  • The next_cursor of the previous response

  • Rows per page

  • Show the data of this brand for each row

  • Filter by a cited domain

  • Filter by a cited URL

  • Filter by a domain in the sources of the answer

  • Filter by a URL in the sources of the answer

Responses

  • List executions.

    • Properties: 16
    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/executions
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/executions?timeframe=30d&tag_mode=any&last_run_only=false&found=any&per_page=25' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": [
    {
      "execution_id": "123e4567-e89b-12d3-a456-426614174000",
      "prompt_id": 1,
      "prompt": null,
      "engine": "chatgpt_gui",
      "model": null,
      "region": null,
      "executed_at": "string",
      "web_search": true,
      "has_response": true,
      "own_brand": {
        "found": true,
        "rank": 1,
        "sentiment": null
      },
      "brands_found": 1,
      "citations_count": 1,
      "brand": {
        "name": "string",
        "rank": 1,
        "sentiment": null
      },
      "cited_count": null,
      "sources_count": 1,
      "sources_status": "string"
    }
  ],
  "meta": {
    "next_cursor": null,
    "total": 1
  }
}

Get execution

​

Use this call to get one execution with the text of the answer, the brands, the citations and the sources.

Path Parameters

  • AI Visibility domain ID

  • Execution ID

Responses

  • Get execution.

    • Properties: 13
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/executions/{execution_id}
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/executions/0b7f0b4e-3d1a-4a6f-9c0e-2f6a8d1c5e77 \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "execution_id": "123e4567-e89b-12d3-a456-426614174000",
    "prompt": {
      "id": 1,
      "prompt": "string",
      "engine": "chatgpt_gui",
      "region": null,
      "web_search": true
    },
    "engine": "chatgpt_gui",
    "model": null,
    "region": null,
    "executed_at": "string",
    "web_search": true,
    "response": "string",
    "citations": [
      {
        "index": 1,
        "url": "string",
        "category": "string",
        "category_group": "string",
        "is_own_site": true
      }
    ],
    "brands": [
      {
        "name": "string",
        "rank": 1,
        "is_own": true,
        "is_competitor": true,
        "mention": "string",
        "sentiment": null,
        "sentiment_positive": [
          "string"
        ],
        "sentiment_neutral": [
          "string"
        ],
        "sentiment_negative": [
          "string"
        ],
        "sentiment_reason": "string"
      }
    ],
    "sources": [
      {
        "url": "string",
        "title": "string",
        "site_name": "string",
        "position": 1,
        "cited": true,
        "is_own_site": true
      }
    ],
    "sources_ordered": true,
    "sources_status": "string"
  }
}

Get competitors

​

Use this call to compare your brand with the other brands in the answers.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Compare these brands. 50 at most. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

Responses

  • Get competitors.

    • Properties: 6
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/competitors
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/competitors?timeframe=30d&aggregation=daily&tag_mode=any&last_run_only=false' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "brands": [
      {
        "name": "string",
        "is_own": true,
        "current": {
          "visibility_score": 1,
          "detection_rate": 1,
          "avg_rank": 1,
          "top3_rate": 1,
          "mentions": 1,
          "citations": 1,
          "avg_sentiment": null,
          "executions": 1,
          "latest_rank": null,
          "missed_executions": 1
        },
        "previous": {
          "visibility_score": 1,
          "detection_rate": 1,
          "avg_rank": 1,
          "top3_rate": 1,
          "mentions": 1,
          "citations": 1,
          "avg_sentiment": null,
          "executions": 1
        }
      }
    ],
    "others": {
      "brand_count": 1,
      "mentions": 1,
      "citations": 1
    },
    "series": {
      "points": [
        {
          "bucket": "string",
          "brands": [
            {
              "name": "string",
              "visibility_score": 1,
              "detection_rate": 1,
              "avg_rank": 1,
              "mentions": 1,
              "citations": 1
            }
          ]
        }
      ]
    },
    "by_engine": [
      {
        "engine": "chatgpt_gui",
        "executions": 1,
        "brands": [
          {
            "name": "string",
            "is_own": true,
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "mentions": 1
          }
        ]
      }
    ],
    "by_topic": [
      {
        "topic_id": null,
        "topic_name": null,
        "executions": 1,
        "brands": [
          {
            "name": "string",
            "is_own": true,
            "visibility_score": 1,
            "detection_rate": 1,
            "avg_rank": 1,
            "mentions": 1
          }
        ]
      }
    ]
  }
}

Get competitor matchup

​

Use this call to compare the rank of one brand with the rank of your brand for each prompt.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

  • Brand to compare with your brand

  • Filter by the result of the comparison

    values
    they_winyou_winlevelall
  • Page number

  • Rows per page

Responses

  • Get competitor matchup.

    • Properties: 3
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/competitors/matchup
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/competitors/matchup?timeframe=30d&tag_mode=any&last_run_only=false&brand=&page=1&per_page=25' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "counts": {
      "additionalProperty": 1
    },
    "prompts": [
      {
        "prompt_id": 1,
        "prompt": "string",
        "engine": "chatgpt_gui",
        "their_rank": null,
        "own_rank": null,
        "last_executed_at": null,
        "outcome": "they_win"
      }
    ],
    "pagination": {
      "page": 1,
      "per_page": 1,
      "total": 1,
      "pages": 1
    }
  }
}

Get citations

​

Use this call to get the domains and the URLs that the engines cite.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Compare these brands. 50 at most. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

  • Filter by domain or URL

  • Filter the rows

    values
    allgapsownother
  • Sort field

    values
    citationschangeowncompetitorsgapotherlast_seen
  • Sort order

  • Page number

  • Rows per page

Responses

  • Get citations.

    • Properties: 4
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/citations
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/citations?timeframe=30d&aggregation=daily&tag_mode=any&last_run_only=false&sort=citations&order=desc&page=1&per_page=25' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "kpis": {
      "total_citations": {
        "current": 1,
        "previous": null
      },
      "unique_urls": {
        "current": 1,
        "previous": null
      },
      "unique_domains": {
        "current": 1,
        "previous": null
      },
      "own_citations": {
        "current": 1,
        "previous": null
      },
      "own_site_citations": {
        "current": 1,
        "previous": null
      },
      "third_party_own_citations": {
        "current": 1,
        "previous": null
      },
      "competitor_citations": {
        "current": 1,
        "previous": null
      },
      "prompts": 1,
      "engines": 1
    },
    "pagination": {
      "page": 1,
      "per_page": 1,
      "total": 1,
      "pages": 1
    },
    "domains": [
      {
        "cited_domain": "string",
        "citations": 1,
        "previous_citations": null,
        "unique_urls": 1,
        "own_mentions": 1,
        "competitor_mentions": 1,
        "other": null,
        "is_own_site": true,
        "brand_site": null,
        "first_seen": "string",
        "first_seen_ever": "string",
        "last_seen": "string",
        "category_groups": [
          "string"
        ],
        "urls": [
          {
            "url": "string",
            "citations": 1,
            "category": "string",
            "category_group": "string",
            "regions": [
              "string"
            ],
            "first_seen": "string",
            "last_seen": "string",
            "own_mentions": 1,
            "competitor_mentions": 1,
            "other": null,
            "prompt_ids": [
              1
            ]
          }
        ]
      }
    ]
  }
}

Get sources

​

Use this call to get the domains in the source panels that the engines show with an answer.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

  • Filter by domain or URL

  • Filter the rows

  • Sort field

    values
    appearancesratechangepositionpagesfirst_seenlast_seencitations
  • Sort order

  • Page number

  • Rows per page

Responses

  • Get sources.

    • Properties: 4
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/sources
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/sources?timeframe=30d&aggregation=daily&tag_mode=any&last_run_only=false&sort=appearances&order=desc&page=1&per_page=25' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "kpis": {
      "own_source_runs": {
        "current": null,
        "previous": null
      },
      "own_source_rate": {
        "current": null,
        "previous": null
      },
      "own_source_not_named": {
        "current": null,
        "previous": null
      },
      "captured_runs": {
        "current": null,
        "previous": null
      },
      "source_domains": {
        "current": null,
        "previous": null
      },
      "source_urls": {
        "current": null,
        "previous": null
      }
    },
    "pagination": {
      "page": 1,
      "per_page": 1,
      "total": 1,
      "pages": 1
    },
    "domains": [
      {
        "source_domain": "string",
        "appearances": 1,
        "appearance_rate": null,
        "previous_appearances": null,
        "avg_position": null,
        "pages": 1,
        "first_seen": "string",
        "last_seen": "string",
        "citations": 1,
        "category_groups": [
          "string"
        ],
        "is_own_site": true,
        "urls": [
          {
            "url": "string",
            "appearances": 1,
            "avg_position": null,
            "last_seen": "string"
          }
        ]
      }
    ]
  }
}

Get sentiment

​

Use this call to get the sentiment of the answers for your brand and the other brands.

Path Parameters

  • AI Visibility domain ID

Query Parameters

  • Preset window. Do not combine with from and to.

    values
    24h7d30d3m1y
  • Start of a custom window. YYYY-MM-DD. Send to with it.

  • End of a custom window. YYYY-MM-DD. Not before from. The window is 366 days at most.

  • Start of the window to compare against. YYYY-MM-DD. Send compare_to with it, or the API returns 422. Leave both out to compare with the window of the same length that ends the day before from. Not with last_run_only.

  • End of the window to compare against. YYYY-MM-DD. Before the start of the window. The length may differ from the window's, 366 days at most.

  • Bucket size of the series. hourly needs a window of 7 days or less.

    values
    hourlydailyweeklymonthly
  • Filter by engine. Repeat the parameter.

  • Filter by topic name. Repeat the parameter.

  • Filter by prompt ID. Repeat the parameter.

  • Filter by tag. Repeat the parameter.

  • any matches a prompt with one of the tags[]. all needs every tag.

  • branded reads only the prompts that name your brand, non_branded only the others. Leave it out to read every prompt. A prompt is branded when its text names your brand (one of the brand names of the domain, or the domain name, such as acme for acme.com), unless branded is set on the prompt.

  • Filter by region code, for example US. Repeat the parameter.

  • Use only the newest execution of each prompt. The response has no previous window.

Responses

  • Get sentiment.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A query parameter is invalid.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}/sentiment
curl 'https://app.keyword.com/api/v2/ai-visibility/domains/5678/sentiment?timeframe=30d&aggregation=daily&tag_mode=any&last_run_only=false' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "window": {
      "from": "string",
      "to": "string",
      "previous_from": null,
      "previous_to": null,
      "aggregation": "string",
      "executions": 1,
      "previous_executions": null
    },
    "brands": [
      {
        "name": "string",
        "is_own": true,
        "current": {
          "avg_sentiment": null,
          "positive": 1,
          "neutral": 1,
          "negative": 1,
          "answers": {
            "positive": 1,
            "neutral": 1,
            "negative": 1
          },
          "phrase_mentions": {
            "positive": 1,
            "neutral": 1,
            "negative": 1
          }
        },
        "previous": {
          "avg_sentiment": null,
          "positive": 1,
          "neutral": 1,
          "negative": 1,
          "answers": {
            "positive": 1,
            "neutral": 1,
            "negative": 1
          },
          "phrase_mentions": {
            "positive": 1,
            "neutral": 1,
            "negative": 1
          }
        },
        "scored_executions": 1,
        "by_engine": [
          {
            "engine": "chatgpt_gui",
            "avg_sentiment": null,
            "executions": 1
          }
        ],
        "phrases": {
          "positive": [
            {
              "phrase": "string",
              "executions": 1,
              "prompts": [
                {
                  "prompt_id": 1,
                  "prompt": "string",
                  "executions": 1
                }
              ]
            }
          ],
          "neutral": [
            {
              "phrase": "string",
              "executions": 1,
              "prompts": [
                {
                  "prompt_id": 1,
                  "prompt": "string",
                  "executions": 1
                }
              ]
            }
          ],
          "negative": [
            {
              "phrase": "string",
              "executions": 1,
              "prompts": [
                {
                  "prompt_id": 1,
                  "prompt": "string",
                  "executions": 1
                }
              ]
            }
          ]
        },
        "reasons": [
          {
            "reason": "string",
            "execution_id": "123e4567-e89b-12d3-a456-426614174000"
          }
        ]
      }
    ]
  }
}

AI Visibility Domains

​

List and get the AI Visibility domains of the account.

List domains

​

Use this call to list the AI Visibility domains of the account.

The response is a paginated list with data, links and meta.

Query Parameters

  • Filter domains by name

  • Rows per page

Responses

  • List domains.

    • Properties: 4
    • Page links

    • Page numbers and totals

    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains
curl 'https://app.keyword.com/api/v2/ai-visibility/domains?per_page=15' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": [
    {
      "id": 1,
      "domain": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "links": {},
  "meta": {}
}

Get domain

​

Use this call to get one AI Visibility domain.

Path Parameters

  • AI Visibility domain ID

Responses

  • Get domain.

    • Properties: 4
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • Rate limit exceeded. The limit is 120 requests in 60 seconds for each data route.

Request Example for get/api/v2/ai-visibility/domains/{domain_id}
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678 \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "id": 1,
    "domain": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}

AI Visibility Prompts

​

Add project prompts

​

Use this call to add the first prompts of a project. The call creates the AI Visibility domain of the project when the account has none for its host.

Important Notes:

  1. Send domain when the project has no URL and its name is not a domain. With no URL, the project takes the sent domain, or else the domain of its name, as its URL.

  2. A group, an archived project or a deleted project gives a 422.

  3. The response has the domain_id. Use it in the domain routes.

Path Parameters

  • Project ID

Body

required
application/json
  • Prompts to add. 500 at most.

    Properties: 7
  • Domain to track. Only for a project with no URL. Must be a domain name, and must match the project host when the project has a URL.

Responses

  • Prompts added.

    • Properties: 3
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for post/api/v2/projects/{project_id}/ai-visibility/prompts
curl https://app.keyword.com/api/v2/projects/1234/ai-visibility/prompts \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "prompts": [
    {
      "prompt": "What is the best rank tracker for SEO agencies?",
      "topic": "Rank tracking",
      "tags": [
        "agencies"
      ],
      "region": "US",
      "engines": [
        "chatgpt_gui",
        "perplexity_gui"
      ],
      "frequency": "daily",
      "frequency_every_n": 1
    }
  ]
}'
{
  "data": {
    "domain_id": 1,
    "added_count": 1,
    "duplicate_count": 1
  }
}

Add prompts

​

Use this call to add prompts to a domain. The API adds one prompt for each engine you send.

Important Notes:

  1. A prompt that the domain already tracks on the same engine and region counts as a duplicate. The API does not change it.

  2. A topic name that the domain does not have yet creates the topic.

Path Parameters

  • AI Visibility domain ID

Body

required
application/json
  • Prompts to add. 500 at most.

    Properties: 7

Responses

  • Prompts added.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for post/api/v2/ai-visibility/domains/{domain_id}/prompts
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "prompts": [
    {
      "prompt": "What is the best rank tracker for SEO agencies?",
      "topic": "Rank tracking",
      "tags": [
        "agencies"
      ],
      "region": "US",
      "engines": [
        "chatgpt_gui",
        "perplexity_gui"
      ],
      "frequency": "weekly",
      "frequency_every_n": 2
    }
  ]
}'
{
  "data": {
    "added_count": 1,
    "duplicate_count": 1
  }
}

Edit prompts

​

Use this call to change the settings and the tags of several prompts.

Important Notes:

  1. Send updates or tags, or both.

  2. updates sets a value on every prompt in ids.

  3. The API skips a prompt when the change gives a prompt that the domain already tracks, or more than 20 tags.

  4. An ID that is not a prompt of the domain is ignored and not counted.

  5. You cannot change the prompt text or the engine.

Path Parameters

  • AI Visibility domain ID

Body

required
application/json
  • Prompt IDs. 500 at most.

  • Tags to add and to remove

    Properties: 2
  • Prompt settings to change. A field that you do not send keeps its value.

    Properties: 6

Responses

  • Prompts changed.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for patch/api/v2/ai-visibility/domains/{domain_id}/prompts
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "ids": [
    91011,
    91012
  ],
  "updates": {
    "status": "inactive"
  },
  "tags": {
    "add": [
      "agencies"
    ]
  }
}'
{
  "data": {
    "updated_count": 1,
    "skipped_count": 1
  }
}

Remove prompts

​

Use this call to remove prompts from a domain.

Important Notes:

  1. A removed prompt stops running, and the reports leave out its executions. Adding the same prompt again brings it back with its executions.

  2. An ID that is not a prompt of the domain is ignored and not counted.

Path Parameters

  • AI Visibility domain ID

Body

required
application/json
  • Prompt IDs. 500 at most.

Responses

  • Prompts removed.

    • Properties: 1
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for delete/api/v2/ai-visibility/domains/{domain_id}/prompts
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts \
  --request DELETE \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "ids": [
    91011
  ]
}'
{
  "data": {
    "deleted_count": 1
  }
}

Edit prompt

​

Use this call to change the settings and the tags of one prompt.

Important Notes:

  1. A field that you do not send keeps its value. tags replaces the full list.

  2. A region where the domain already tracks the prompt on the same engine gives a 422.

  3. You cannot change the prompt text or the engine.

Path Parameters

  • AI Visibility domain ID

  • Prompt ID

Body

required
application/json

Prompt settings to change. A field that you do not send keeps its value.

Responses

  • Prompt changed.

    • Properties: 1
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for patch/api/v2/ai-visibility/domains/{domain_id}/prompts/{prompt_id}
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts/91011 \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "region": "GB",
  "frequency": "weekly",
  "frequency_every_n": 1,
  "tags": [
    "agencies"
  ]
}'
{
  "data": {
    "updated_count": 1
  }
}

Estimate a prompt run

​

Use this call to see what a run of the selected prompts starts and costs, before you start it. The call starts nothing.

Important Notes:

  1. The body is the body of Run prompts.

  2. enough is false when the credits left do not cover the run.

  3. One run takes max_prompts prompts at most.

Path Parameters

  • AI Visibility domain ID

Body·

required
application/json

Send ids, or scope with the filters. Do not send both. The filters apply only with scope.

  • full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21

  • Prompt IDs. 500 at most.

  • Prompt IDs

  • Select every prompt that List prompts shows for the filters, on all pages

  • Filter by prompt text

  • values
    24h7d30d3m1y

Responses

  • Estimate of the run.

    • Properties: 8
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
  • Rate limit exceeded. The limit is 30 requests in 60 seconds.

Request Example for post/api/v2/ai-visibility/domains/{domain_id}/prompts/runs/estimate
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts/runs/estimate \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "ids": [
    91011,
    91012
  ]
}'
{
  "data": {
    "prompt_count": 1,
    "run_count": 1,
    "credits": 1,
    "by_engine": [
      {
        "engine": "chatgpt_gui",
        "runs": 1,
        "credits": 1
      }
    ],
    "skipped": {
      "paused": 1,
      "refreshing": 1,
      "unsupported": 1
    },
    "balance": {
      "used": 1,
      "remaining": 1,
      "limit": 1
    },
    "enough": true,
    "max_prompts": 1
  }
}

Run prompts

​

Use this call to run the selected prompts one time now, outside their schedule. Each run uses credits.

Important Notes:

  1. Send the prompt ids, or scope: filters with the filters of List prompts. scope: filters selects every prompt the list shows for the filters, on all pages.

  2. The API skips paused prompts and prompts with a run in progress.

  3. A run with no prompt to run, more than 200 prompts, or not enough credits gives a 422. The credits error is under the credits key of new_errors.

  4. The results arrive in the read routes when the runs end.

Path Parameters

  • AI Visibility domain ID

Body·

required
application/json

Send ids, or scope with the filters. Do not send both. The filters apply only with scope.

  • full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21

  • Prompt IDs. 500 at most.

  • Prompt IDs

  • Select every prompt that List prompts shows for the filters, on all pages

  • Filter by prompt text

  • values
    24h7d30d3m1y

Responses

  • Runs started.

    • Properties: 3
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
  • Rate limit exceeded. The limit is 10 requests in 60 seconds.

Request Example for post/api/v2/ai-visibility/domains/{domain_id}/prompts/runs
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/prompts/runs \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "scope": "filters",
  "tags": [
    "agencies"
  ],
  "status": "active"
}'
{
  "data": {
    "started_count": 1,
    "credits": 1,
    "skipped": {
      "paused": 1,
      "refreshing": 1,
      "unsupported": 1
    }
  }
}

Add topics

​

Use this call to add topics to a domain.

Important Notes:

  1. A name that a topic of the domain already has, in any case, counts as existing. The API does not change it.

  2. A name that repeats in the request counts one time.

Path Parameters

  • AI Visibility domain ID

Body

required
application/json
  • Topic names. 50 at most.

Responses

  • Topics added.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for post/api/v2/ai-visibility/domains/{domain_id}/topics
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/topics \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "names": [
    "Pricing",
    "Agencies"
  ]
}'
{
  "data": {
    "created_count": 1,
    "existing_count": 1
  }
}

Rename topic

​

Use this call to rename a topic. The topic keeps its ID and its prompts.

Important Notes:

  1. A name that another topic of the domain has gives a 422. A change of case only is allowed.

Path Parameters

  • AI Visibility domain ID

  • Topic ID

Body

required
application/json
  • New topic name

Responses

  • Topic renamed.

    • Properties: 2
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for patch/api/v2/ai-visibility/domains/{domain_id}/topics/{topic_id}
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/topics/1213 \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Plans"
}'
{
  "data": {
    "id": 1,
    "name": "string"
  }
}

Delete topic

​

Use this call to delete a topic. Its prompts stay, with no topic.

Path Parameters

  • AI Visibility domain ID

  • Topic ID

Responses

  • Topic deleted.

    • Properties: 1
    application/json
  • Authentication failed. The API token is invalid or missing.

    • Properties: 4
    application/json
  • The account or the role cannot use the route. Causes: no AI Visibility add-on, a role without aiv.view (viewer), a role without projects.write on a write route, or a domain of another account.

    • Properties: 4
    application/json
  • The project, domain, prompt, topic or execution does not exist, or it belongs to another account.

    • Properties: 4
    application/json
  • A body field is invalid, or the domain cannot take the change.

    • Properties: 4
    • Error messages by field. A run without enough credits has its error under credits.

      Properties: 1
    application/json
Request Example for delete/api/v2/ai-visibility/domains/{domain_id}/topics/{topic_id}
curl https://app.keyword.com/api/v2/ai-visibility/domains/5678/topics/1213 \
  --request DELETE \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "deleted_count": 1
  }
}

Models

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​