REST API

ESG Hub API提供简单的HTTP JSON端点来搜索和检索ESG内容。

入门

API完全开放,无需任何认证。

基础URLAll API requests should be made to: https://esg-hub.ascent.partners/api/v1

快速开始

  1. Choose an endpoint below (e.g., /api/v1/pages for articles)
  2. Make a request using cURL, JavaScript, or Python
  3. Parse the JSON response for the data you need

代码示例

curl -s "https://esg-hub.ascent.partners/api/v1/pages?limit=3" | jq .

认证

无需认证API完全开放,无需任何认证。

端点

GET/api/v1/meta

Get metadata about the ESG Hub knowledge base, including article counts, section statistics, and database timestamps.

请求示例

curlbash
curl -s "https://esg-hub.ascent.partners/api/v1/meta"

响应

json
{
  "total_pages": 351,
  "total_resources": 244,
  "sections": [
    { "name": "environmental", "count": 23 },
    { "name": "governance", "count": 65 }
  ],
  "updated_at": "2026-02-24T12:00:00Z"
}
GET/api/v1/pages

List all ESG articles with optional filtering. Supports filtering by section, pillar, and full-text search.

参数

名称类型必填描述
sectionstring可选Filter by section (e.g., 'environmental', 'governance')
pillarstring可选Filter by pillar: 'Environmental', 'Social', or 'Governance'
qstring可选Full-text search in title and description
limitnumber可选Results per page (default: 20, max: 100)
offsetnumber可选Pagination offset

请求示例

curlbash
# List all pages
curl -s "https://esg-hub.ascent.partners/api/v1/pages?limit=5"

# Filter by section
curl -s "https://esg-hub.ascent.partners/api/v1/pages?section=environmental&limit=10"

# Search for climate
curl -s "https://esg-hub.ascent.partners/api/v1/pages?q=climate&limit=5"

响应

json
{
  "data": [
    {
      "id": "page:abc123",
      "title": "Climate Change",
      "description": "Understanding climate risks...",
      "section": "environmental",
      "pillar": "Environmental",
      "permalink": "/environmental/climate-change/"
    }
  ],
  "pagination": {
    "total": 351,
    "limit": 5,
    "offset": 0,
    "has_more": true
  }
}
GET/api/v1/pages/:id

Get a single page by its ID. Returns full content including markdown and metadata.

请求示例

curlbash
curl -s "https://esg-hub.ascent.partners/api/v1/pages/page:abc123"

响应

json
{
  "id": "page:abc123",
  "title": "Climate Change",
  "content": "# Climate Change\n\nClimate change refers to...",
  "keywords": "climate, carbon, emissions",
  "created_at": "2024-01-15T10:30:00Z"
}
GET/api/v1/resources

List curated external ESG resources. These are links to external articles, reports, and tools.

参数

名称类型必填描述
typestring可选Filter by type: 'article', 'report', 'tool', 'dataset'
qstring可选Search in title and description
limitnumber可选Results per page (default: 20)

请求示例

curlbash
# List all resources
curl -s "https://esg-hub.ascent.partners/api/v1/resources?limit=5"

# Filter by type
curl -s "https://esg-hub.ascent.partners/api/v1/resources?type=report&limit=10"

响应

json
{
  "data": [
    {
      "id": "resource:xyz789",
      "title": "TCFD Recommendations",
      "url": "https://assets.bbhub.io/...",
      "type": "report",
      "source": "TCFD"
    }
  ],
  "pagination": { "total": 244, "limit": 5, "offset": 0 }
}

错误处理

API返回标准HTTP状态码和错误消息。

Error Responsejson
{
  "error": "Missing required parameter: q"
}
状态含义
400400 错误请求
404404 未找到
500500 服务器错误

速率限制

无严格速率限制请尊重他人并尽可能缓存响应。
REST API Documentation — ESG Hub — ESG枢纽