Skip to Content
APIEndpointsAdd competitor domain

Add competitor domain

A competitor is rarely one domain. They publish on country domains, on a docs subdomain, or on one section of a site they do not otherwise own. Adding an address here means citations to it count toward that competitor.

Requires the write:competitors scope, and the workspace must be enabled for API writes.

POST /v1/brands/{brand_id}/competitors/{competitor_id}/domains

This applies to answers already collected. Adding an address re-attributes citations that were already recorded, so the competitor’s citation rate can move the moment this returns. It is not only forward-looking.

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
competitor_iduuidrequiredFrom List competitors

Query parameters

None.

Body

application/json

FieldTypeRequiredDescription
addressstring, up to 2048 charsrequiredA whole domain like example.de, or one section like example.com/product or help.example.com

You do not say which kind it is. The address itself decides: anything narrower than a whole registrable domain is stored as a section, anything else as a domain.

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/competitors/c4a7e1b2-38d9-4f60-b5ac-2d90e7f14b83/domains' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: <unique-per-attempt>' \ --header 'Content-Type: application/json' \ --data '{"address":"ahrefs.de"}'

Response

{ "data": { "competitor_id": "c4a7e1b2-38d9-4f60-b5ac-2d90e7f14b83", "addresses": { "main": "ahrefs.com", "apexes": ["ahrefs.de", "ahrefs.fr"], "sections": ["help.ahrefs.com"] } }, "request_id": "req_2f6b90ce41a34d17b8ea" }

Response fields

FieldTypeDescription
data.competitor_iduuidrequired
data.addresses.mainstring | nullrequired. Derived from the competitor’s primary_url
data.addresses.apexesstring[]required. Whole domains. Their subdomains are included
data.addresses.sectionsstring[]required. Host or host/path claims on a site not otherwise theirs
request_idstringrequired. Also returned as the x-request-id header

The full resulting set is returned, not just what you added, so you never need a follow-up read to see where the competitor now stands.

Errors

StatusCodeWhen
400invalid_requestUnknown field, missing address, or an address that is not a valid web address
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:competitors
403plan_requiredThis workspace is not enabled for API writes
404not_foundThe brand or competitor does not exist, or this key is not allowed to reach it
429rate_limitedOver 60 requests per minute

Notes

Subdomains are included, country domains are not. Adding example.com also counts docs.example.com and eu.example.com. It does not count example.de, which is a separate registrable domain and needs adding on its own.

Sections are for sites you do not own outright. example.com/product claims only that path and the pages under it, leaving the rest of example.com as an ordinary third-party source. Use it when a competitor has a presence on a shared platform rather than their own site.

Adding is idempotent in effect. An address already present stays present; the stored set is deduplicated, so re-adding is harmless.

Read the current set with Get competitor, which returns the same domains object.

Idempotency-Key is required. See Idempotency.

Last updated on