# 小红书 笔记发布地点 API (xiaohongshu.note_location)

- Canonical page: https://everyinfra.com/xiaohongshu-api/note_location
- Endpoint: POST /api/v1/social with {"platform": "xiaohongshu", "action": "note_location", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=xiaohongshu&action=note_location

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 笔记链接（/explore/<笔记ID> 或 /discovery/item/<笔记ID>）或小红书分享短链。只要笔记 ID，不需要 xsec_token；带上了的话返回的笔记链接也带上它。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| note_id | 笔记 ID，评论类能力用它回指所属笔记。 |
| url | 该记录在小红书上的链接。search、note、profile、hashtag 返回的链接一般带访问令牌，未登录的浏览器也能打开（令牌有时效，过期后重新调用即可）；user_posts 返回的笔记链接不带令牌，在浏览器里打开需要令牌：用笔记 ID 调 note 能拿到可以打开的链接；search_users 返回的主页链接同样不带令牌，用 user_id 调 profile 拿能打开的链接。pgy_content_square 不带 keyword 时笔记链接带令牌，带 keyword 时不带（用笔记 ID 调 note 拿能打开的链接）。followers_list 返回的是粉丝的主页链接，同样不带令牌；note_location 返回的笔记链接带上了请求里的令牌（请求里没带就没有）。 |
| location_text | 笔记标的发布地点原文（note_location），如 北京市·星巴克(国贸店)；标了多个地点时是「广州市等」这类文字。笔记没标地点时整条结果为空。 |
| city | 发布地点里的城市（note_location），即「·」前面那段，如 北京市；标了多个地点时没有这个字段。 |
| poi_name | 地点名称：search 是搜索结果卡片上标的地点；note_location 是笔记标的发布地点里「·」后面的那段（如 星巴克(国贸店)）。没标地点或标了多个地点时没有这个字段。 |
| poi_ids | 发布地点的地点 ID 列表（note_location），按页面顺序；标了多个地点时有多个。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "xiaohongshu",
  "action": "note_location",
  "params": {
    "url": "https://www.xiaohongshu.com/explore/6a97c1c2000000002b00074e"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "xiaohongshu",
        "action": "note_location",
        "params": {
            "url": "https://www.xiaohongshu.com/explore/6a97c1c2000000002b00074e",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "xiaohongshu",
  "action": "note_location",
  "results": {
    "note_id": …,
    "url": …,
    "location_text": …,
    "city": …,
    "poi_name": …,
    "poi_ids": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=xiaohongshu
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
