Skip to main content
Competitors are the brands Topify.ai tracks alongside yours across AI responses. This endpoint returns active competitors with aggregated visibility, sentiment, and position metrics.

List competitors

GET /projects/{project_id}/competitors
Returns all active competitors for a project with aggregated metrics for the given date range.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID

Query parameters

ParamTypeDefaultDescription
duration_daysinteger7Days to look back
date_fromstringStart date (YYYY-MM-DD)
date_tostringEnd date (YYYY-MM-DD)
providersstringComma-separated provider filter
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/competitors?duration_days=7" \
  -H "X-API-Key: tk_live_..."

Response

{
  "success": true,
  "data": {
    "active_competitors": [
      {
        "competitor_id": "00000000-0000-0000-0000-000000000000",
        "project_id": "a1b2c3d4-...",
        "name": "Acme Corp",
        "website": "https://acme.com",
        "icon_url": "https://logo.clearbit.com/acme.com",
        "icon_urls": [
          "https://logo.clearbit.com/acme.com",
          "https://www.google.com/s2/favicons?domain=acme.com&sz=64"
        ],
        "state": "active",
        "is_own_brand": true,
        "metrics": {
          "visibility": 85.0,
          "sentiment": 72.0,
          "position": 1.8,
          "mention_count": null,
          "days_with_data": 7,
          "period": "2026-02-27 to 2026-03-06"
        }
      },
      {
        "competitor_id": "c1d2e3f4-...",
        "project_id": "a1b2c3d4-...",
        "name": "Competitor A",
        "website": "https://competitor-a.com",
        "icon_url": "https://logo.clearbit.com/competitor-a.com",
        "icon_urls": [
          "https://logo.clearbit.com/competitor-a.com",
          "https://www.google.com/s2/favicons?domain=competitor-a.com&sz=64"
        ],
        "state": "active",
        "is_own_brand": false,
        "metrics": {
          "visibility": 72.0,
          "sentiment": 65.0,
          "position": 3.1,
          "mention_count": null,
          "days_with_data": 7,
          "period": "2026-02-27 to 2026-03-06"
        }
      }
    ],
    "total_active": 8
  }
}

CompetitorResponse fields

FieldTypeNullableDescription
competitor_idstring (UUID)NoCompetitor ID. 00000000-... for injected own brand
project_idstring (UUID)NoParent project ID
namestringNoCompetitor brand name
websitestringNoCompetitor website URL
icon_urlstringYesPrimary logo URL
icon_urlsstring[]NoMultiple logo URL sources (Clearbit + Google favicon)
statestringYesAlways active in this endpoint
is_own_brandbooleanNotrue if this is your own brand
metricsCompetitorMetricsYesAggregated metrics for the date range

CompetitorMetrics fields

FieldTypeNullableDescription
visibilityfloatYesAverage visibility score across the period
sentimentfloatYesAverage sentiment score across the period
positionfloatYesAverage position in AI responses
mention_countintegerYesTotal mention count (may be null)
days_with_dataintegerYesNumber of days with collected data
periodstringNoHuman-readable date range (e.g., 2026-02-27 to 2026-03-06)
Your own brand is always included in the response with is_own_brand: true. If your brand doesn’t already exist as a competitor, it is injected automatically with zeroed metrics so you can compare directly.

Create competitors

POST /projects/{project_id}/competitors
Add one or more competitor brands to a project. Each competitor begins tracking immediately.
Requires an admin-scoped API key. Viewer keys receive a 403 response.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project to add competitors to

Request body

FieldTypeRequiredDescription
competitorsobject[]YesArray of competitors to add (1—20 per request)
competitors[].namestringYesBrand name
competitors[].websitestringYesWebsite domain or URL (e.g. acme.com or https://acme.com)
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/competitors" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "competitors": [
      {"name": "Acme Corp", "website": "acme.com"},
      {"name": "Globex Inc", "website": "globex.net"}
    ]
  }'

Response

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "projectId": "a1b2c3d4-...",
    "created": 2,
    "competitors": [
      {
        "competitorId": "c1d2e3f4-...",
        "projectId": "a1b2c3d4-...",
        "name": "Acme Corp",
        "website": "https://acme.com",
        "iconUrl": "https://img.logo.dev/acme.com?token=...",
        "iconUrls": ["https://img.logo.dev/acme.com?token=..."],
        "state": "active",
        "isOwnBrand": false,
        "metrics": null
      }
    ]
  }
}

Error responses

StatusCause
400Empty competitors array, empty name, invalid website URL, or duplicate domain in request
403API key has read-only (viewer) access
409A competitor with the same domain already exists in this project
429Active competitor limit reached (max 10)

Update competitor

PATCH /projects/{project_id}/competitors/{competitor_id}
Update the name or website of an existing competitor.
Requires an admin-scoped API key.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
competitor_idstring (UUID)The competitor to update

Request body

All fields are optional. Include only the fields you want to change.
FieldTypeDescription
namestringNew brand name (cannot be empty)
websitestringNew website domain or URL
curl -X PATCH "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/competitors/{competitor_id}" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Inc", "website": "acmeinc.com"}'

Response

Returns the updated competitor with all fields (same shape as items in list competitors).

Error responses

StatusCause
400Empty request body, whitespace-only name, invalid website URL, or no fields changed
403API key has read-only access
404Competitor not found in this project

Delete competitor

DELETE /projects/{project_id}/competitors/{competitor_id}
Permanently remove a competitor from your project and stop tracking it.
This action cannot be undone. Requires an admin-scoped API key.

Path parameters

ParamTypeDescription
project_idstring (UUID)The project ID
competitor_idstring (UUID)The competitor to delete
curl -X DELETE "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/competitors/{competitor_id}" \
  -H "X-API-Key: tk_live_..."

Response

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "competitorId": "c1d2e3f4-...",
    "message": "Competitor deleted successfully"
  }
}

Error responses

StatusCause
403API key has read-only access
404Competitor not found in this project