跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.topify.ai/llms.txt

Use this file to discover all available pages before exploring further.

搜索词是 Topify.ai 每天在所有 AI 服务商上跟踪的 AI 搜索查询。每个搜索词会生成回复,并被分析以衡量品牌可见度、情感分析、引用和竞争对手提及情况。 API 支持对搜索词进行完整的 CRUD 操作。读取端点对所有 API 密钥开放。写入端点(创建、更新、删除)需要管理员作用域的 API 密钥。

列出搜索词

GET /projects/{project_id}/prompts
返回项目中的所有搜索词,按创建日期排序。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "project_id": "a1b2c3d4-...",
    "total": 25,
    "prompts": [
      {
        "id": "e5f6a7b8-...",
        "project_id": "a1b2c3d4-...",
        "content": "What is the best project management tool?",
        "prompt_type": "active",
        "topic_id": "t1u2v3w4-...",
        "country": "US",
        "visibility": 85.0,
        "sentiment": 72,
        "position": 2.3,
        "volume": 150,
        "cvr": 45.0,
        "intent": "commercial",
        "trend": "up",
        "created_at": "2026-01-15T10:30:00+00:00"
      }
    ]
  }
}

搜索词字段

字段类型可空描述
idstring (UUID)No搜索词 ID
project_idstring (UUID)No父项目 ID
contentstringNoAI 搜索查询文本
prompt_typestringNoactivesuggestedpendinginactiveurl_recommended
topic_idstring (UUID)Yes该搜索词所属的主题
countrystringYes用于本地化回复的目标国家
visibilityfloatYes品牌可见度百分比(0—100)
sentimentintegerYes品牌情感分析评分
positionfloatYes品牌在回复中的平均位置
volumeintegerYes收集到的回复数量
cvrfloatYes内容可见度率
intentstringYes查询意图:informationalcommercialnavigationaltransactional
trendstringYes趋势方向:updownstable
created_atstring (ISO 8601)No创建时间

获取搜索词

GET /projects/{project_id}/prompts/{prompt_id}
返回单个搜索词。字段与列表相同。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
prompt_idstring (UUID)搜索词 ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..."

创建搜索词

POST /projects/{project_id}/prompts
向项目中添加一个或多个搜索词。每个搜索词会立即开始跟踪 —— Topify.ai 将在后台开始收集 AI 回复并计算指标。
需要管理员作用域的 API 密钥。只读密钥会收到 403 响应。

路径参数

参数类型描述
project_idstring (UUID)要添加搜索词的项目

请求体

字段类型必填描述
promptsstring[]Yes要跟踪的搜索词文本数组(每次请求 1—50 个)
topicIdstring (UUID)Yes要将搜索词分配到的主题
countrystringNo用于本地化回复的 ISO 国家代码
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": ["What is the best project management tool?", "Top PM software for teams"],
    "topicId": "t1u2v3w4-...",
    "country": "US"
  }'

响应

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "projectId": "a1b2c3d4-...",
    "created": 2,
    "prompts": [
      {
        "id": "e5f6a7b8-...",
        "projectId": "a1b2c3d4-...",
        "content": "What is the best project management tool?",
        "promptType": "Active",
        "topicId": "t1u2v3w4-...",
        "country": "US",
        "createdAt": "2026-03-30T10:30:00+00:00"
      }
    ]
  }
}

错误响应

状态原因
400搜索词数组为空、内容只有空白字符,或缺少 topicId
403API 密钥具有只读(viewer)权限
409项目中已存在内容相同的搜索词
429已达到您的套餐等级的搜索词配额

更新搜索词

PATCH /projects/{project_id}/prompts/{prompt_id}
更新现有搜索词的内容、国家、主题或类型。
需要管理员作用域的 API 密钥。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
prompt_idstring (UUID)要更新的搜索词

请求体

所有字段均为可选。仅包含您想要修改的字段。
字段类型描述
contentstring新的搜索词文本(不能为空)
countrystringISO 国家代码
topicIdstring (UUID)重新分配到不同的主题
promptTypestring修改搜索词类型(ActiveInactiveSuggested
curl -X PATCH "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "Best project management tools for remote teams"}'

响应

返回更新后的搜索词及其全部字段(与 获取搜索词 形状相同)。

错误响应

状态原因
400请求体为空、内容只有空白字符,或没有字段被修改
403API 密钥具有只读权限
404在此项目中未找到搜索词

删除搜索词

DELETE /projects/{project_id}/prompts/{prompt_id}
永久删除一个搜索词并停止跟踪它。该搜索词的历史分析数据也会一并删除。
此操作不可撤销。需要管理员作用域的 API 密钥。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
prompt_idstring (UUID)要删除的搜索词
curl -X DELETE "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}" \
  -H "X-API-Key: tk_live_..."

响应

{
  "code": 200,
  "message": "200 OK",
  "data": {
    "promptId": "e5f6a7b8-...",
    "message": "Prompt deleted successfully"
  }
}

错误响应

状态原因
403API 密钥具有只读权限
404在此项目中未找到搜索词

搜索词分析

GET /projects/{project_id}/prompts/{prompt_id}/analytics
返回按日期和 AI 服务商分组的可见度、位置和情感分析时间序列数据。

查询参数

参数类型默认值描述
duration_daysinteger7回溯天数
date_fromstring起始日期(YYYY-MM-DD
date_tostring结束日期(YYYY-MM-DD
providersstring以逗号分隔的 AI 服务商筛选
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/analytics?duration_days=7" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "prompt_id": "e5f6a7b8-...",
    "prompt_content": "What is the best project management tool?",
    "volume": 42,
    "sentiment": 72,
    "visibility_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 85.0 },
        { "provider": "perplexity", "value": 90.0 }
      ],
      "2026-03-02": [
        { "provider": "chatgpt", "value": 80.0 }
      ]
    },
    "position_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 2.0 }
      ]
    },
    "sentiment_chart": {
      "2026-03-01": [
        { "provider": "chatgpt", "value": 75.0 }
      ]
    }
  }
}

响应字段

字段类型可空描述
prompt_idstring (UUID)No搜索词 ID
prompt_contentstringNoAI 搜索查询文本
volumeintegerYes收集到的回复总数
sentimentintegerYes该周期内的整体品牌情感分析
visibility_chartobjectNo以日期为键的 ProviderMetric[] 映射(可见度 %)
position_chartobjectNo以日期为键的 ProviderMetric[] 映射(平均位置)
sentiment_chartobjectNo以日期为键的 ProviderMetric[] 映射(平均情感分析)
ProviderMetric:
字段类型描述
providerstringAI 服务商名称(例如 chatgpt
valuefloat该 AI 服务商在该日期的指标值

AI 回复(chats)

GET /projects/{project_id}/prompts/{prompt_id}/chats
返回原始 AI 回复,包括品牌提及、情感分析、位置和引用。

查询参数

搜索词分析 相同。
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/chats?duration_days=7" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "c1d2e3f4-...",
        "date": "2026-03-01T12:00:00+00:00",
        "mentioned": true,
        "position": 2,
        "all_mentions": [
          {
            "name": "Acme Corp",
            "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"]
          }
        ],
        "chat_preview": "When it comes to project management tools...",
        "platform": "chatgpt",
        "model": "gpt-4o",
        "full_content": "When it comes to project management tools, Acme Corp stands out for...",
        "prompt_content": "What is the best project management tool?",
        "references": [
          {
            "title": "Best PM Tools 2026",
            "link": "https://techcrunch.com/best-pm-tools",
            "snippet": "Acme Corp ranked #1...",
            "reference_index": 1
          }
        ],
        "brands_mentioned": {
          "Acme Corp": { "position": 1, "count": 3 },
          "Competitor A": { "position": 2, "count": 1 }
        },
        "sentiment": 80,
        "sentiment_by_brands": {
          "Acme Corp": 80,
          "Competitor A": 60
        }
      }
    ]
  }
}

ChatItem 字段

字段类型可空描述
idstring (UUID)NoLLM 输出 ID
datestring (ISO 8601)No回复生成时间
mentionedbooleanNo您的品牌是否被提及
positionintegerYes您的品牌在此回复中的排名位置
all_mentionsBrandMention[]No此回复中提到的所有品牌
chat_previewstringNo回复的首句(最多 150 字符)
platformstringNoAI 服务商(chatgptperplexitygoogle_ai_overviewgeminiclaude
modelstringNo使用的具体模型(例如 gpt-4o
full_contentstringNo完整的 AI 回复文本
prompt_contentstringNo生成此回复的搜索词
referencesReferenceItem[]No回复中的引用/来源
brands_mentionedobjectYes原始品牌提取数据(品牌名称到位置/计数的映射)
sentimentintegerYes您的品牌在此回复中的情感分析评分
sentiment_by_brandsobjectYes按品牌名称为键的情感分析评分
BrandMention:
字段类型描述
namestring出现在回复中的品牌名称
icon_urlstring主要 logo URL
icon_urlsstring[]多个 logo URL 来源
ReferenceItem:
字段类型描述
titlestring引用标题
linkstring引用 URL
snippetstring引用摘要文本
reference_indexinteger引用在回复中的位置

域名

GET /projects/{project_id}/prompts/{prompt_id}/domains
返回域名级别的引用细分,按引用次数降序排列。

查询参数

搜索词分析 相同。
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/domains?duration_days=7" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "items": [
      {
        "domain": "techcrunch.com",
        "domain_type": 1,
        "citation_count": 15,
        "avg_citations": 2.5,
        "used_percentage": 75.0,
        "mentioned": true,
        "brands_appeared": [
          {
            "name": "Acme Corp",
            "icon_url": "https://logo.clearbit.com/acme.com",
            "icon_urls": ["https://logo.clearbit.com/acme.com"]
          }
        ],
        "favicon_url": "https://www.google.com/s2/favicons?domain=techcrunch.com&sz=64",
        "favicon_urls": [
          "https://logo.clearbit.com/techcrunch.com",
          "https://www.google.com/s2/favicons?domain=techcrunch.com&sz=64"
        ]
      }
    ]
  }
}

DomainItem 字段

字段类型可空描述
domainstringNo域名
domain_typeintegerNo来源类别 ID
citation_countintegerNo在所有回复中的总引用次数
avg_citationsfloatNo引用此域名的回复中的平均引用数
used_percentagefloatNo此域名出现的频率(百分比)
mentionedbooleanNo您的品牌是否与此域名一起出现
brands_appearedBrandInfo[]No在引用此域名的回复中出现的品牌
favicon_urlstringYes主要 favicon URL
favicon_urlsstring[]No多个 favicon URL 来源
BrandInfo:
字段类型描述
namestring品牌名称
icon_urlstring主要 logo URL
icon_urlsstring[]多个 logo URL 来源

URL

GET /projects/{project_id}/prompts/{prompt_id}/urls
返回 URL 级别的引用数据,按提及次数降序排列。

查询参数

搜索词分析 相同。
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/prompts/{prompt_id}/urls?duration_days=7" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "items": [
      {
        "url": "https://techcrunch.com/best-pm-tools-2026",
        "title": "Best PM Tools 2026",
        "domain": "techcrunch.com",
        "url_type": null,
        "url_type_name": "unknown",
        "mentioned_count": 8,
        "brands_appear": [
          {
            "name": "Acme Corp",
            "icon_url": "https://logo.clearbit.com/acme.com",
            "icon_urls": ["https://logo.clearbit.com/acme.com"]
          }
        ],
        "first_seen": "2026-02-15T00:00:00+00:00",
        "last_seen": "2026-03-01T00:00:00+00:00"
      }
    ]
  }
}

UrlItem 字段

字段类型可空描述
urlstringNo完整 URL
titlestringNo页面标题
domainstringNo从 URL 中提取的域名
url_typeintegerYesURL 类型 ID
url_type_namestringNoURL 类型标签(例如 unknown
mentioned_countintegerNo此 URL 被引用的次数
brands_appearBrandInfo[]No在引用此 URL 的回复中出现的品牌
first_seenstring (ISO 8601)No最早被引用的日期
last_seenstring (ISO 8601)No最近被引用的日期