# Xiaohongshu Note location API (xiaohongshu.note_location)

- Canonical page: https://everyinfra.com/en/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 | A note link (/explore/<note ID> or /discovery/item/<note ID>) or a Xiaohongshu share link. Only the note ID is needed, not the xsec_token; if the link carries one, the returned note link keeps it. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| note_id | Note ID. Comment capabilities use it to point back to the note. |
| url | The record's link on Xiaohongshu. Links from search, note, profile and hashtag usually carry an access token, so they open in a signed-out browser (the token expires; call again for a fresh link). Note links from user_posts carry no token and need one to open in a browser: call note with the note ID to get a link that opens. Profile links from search_users carry no token either; call profile with the user_id for one that opens. Note links from pgy_content_square carry a token, except with `keyword`, where they carry none. |
| location_text | The note's tagged place exactly as shown (note_location), such as a city and a café; when several places are tagged it reads like a city followed by etc. An untagged note returns an empty result. |
| city | City of the tagged place (note_location), the part before the dot; absent when several places are tagged. |
| poi_name | Place name: on search, the place tagged on the result card; on note_location, the part of the note's tagged place after the dot, such as a café branch. Absent when no place, or several places, are tagged. |
| poi_ids | Place IDs of the tagged place (note_location), in page order; several when several places are tagged. |
| platform | Source platform identifier, the same as platform in the request (for example 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
