> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aibase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cURL 调用示例

> 使用 cURL 调用 GEOBase 统一入口的完整示例。

所有 GEOBase 开发者 API 共用同一入口，只需替换 `apiCode` 与 `data` 即可调用不同业务能力。

## 通用调用模板

```bash theme={null}
curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
  --header 'Content-Type: application/json' \
  --header 'AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx' \
  --header 'AIBase-Request-Id: req-20260924-001' \
  --data '{
    "apiCode": "geo.brand",
    "data": {
      "brandId": "brand-001"
    }
  }'
```

<Note>
  建议通过环境变量注入密钥，避免将 API Key 写入命令行历史：
  `--header "AIBase-API-Key: ${AIBASE_API_KEY}"`。
</Note>

## 切换业务接口

替换 `apiCode` 与 `data` 即可。以下示例调用平台趋势对比，并传入必填的 `brandId` 与时间范围：

```bash theme={null}
curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
  --header 'Content-Type: application/json' \
  --header "AIBase-API-Key: ${AIBASE_API_KEY}" \
  --data '{
    "apiCode": "llm.trend",
    "data": {
      "brandId": "brand-001",
      "startDate": "2026-09-01",
      "endDate": "2026-09-23"
    }
  }'
```

## 本地调试

本地开发环境服务端口为 `6006`，将域名替换为 `http://localhost:6006` 即可：

```bash theme={null}
curl --location 'http://localhost:6006/v1/openapi/execute' \
  --header 'Content-Type: application/json' \
  --header "AIBase-API-Key: ${AIBASE_API_KEY}" \
  --data '{
    "apiCode": "geo.brand",
    "data": {}
  }'
```

## 只看响应头与状态码

排查鉴权或网关问题时，可只输出状态码与响应头：

```bash theme={null}
curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
  --header 'Content-Type: application/json' \
  --header "AIBase-API-Key: ${AIBASE_API_KEY}" \
  --data '{"apiCode": "geo.brand", "data": {}}' \
  --write-out '\nHTTP_STATUS:%{http_code}\n' \
  --silent --show-error --output /dev/null
```

<Card title="查看业务接口参数" icon="braces" href="/geobase-api/api-reference/brand-list" horizontal>
  每个接口的 `data` 参数不同，请按目标接口页面填写。
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.