# How do I build a keyword-specific content sample ranking?

How do I build a keyword-specific content sample ranking? Follow concrete contracts, examples and reviewable steps using Xiaohongshu (RedNote), Douyin, X (Twitter).

Canonical page: https://datanavoapi.com/en/answers/keyword-viral-content-ranking-api/

This is a local simulation. Program-generated samples are not live platform data and do not establish provider availability.

## Answer

Start by inspecting the contracts and local samples for Xiaohongshu note search, Douyin video search, X post search. Establish the input for xiaohongshu.notes.search, then check whether its post object contains the fields your task needs.

Record the candidate source, sort field, region and observation time. Rank within a sample is not platform-wide rank, and scores from different platforms should not be added together. Local charts deliberately use fictional items.

## Relevant contracts

| Capability | Object | Shape | Pagination |

| --- | --- | --- | --- |

| xiaohongshu.notes.search | Post | items | Explicit cursor |

| douyin.videos.search | Post | items | Explicit cursor |

| x.posts.search | Post | items | Explicit cursor |

- [Xiaohongshu note search](https://datanavoapi.com/en/apis/xiaohongshu/notes/search/)
- [Douyin video search](https://datanavoapi.com/en/apis/douyin/videos/search/)
- [X post search](https://datanavoapi.com/en/apis/x/posts/search/)

## Input contract

Inspect meanings, examples and conditional rules for the selected method. view and fields control the response without changing the TEST unit price.

- Only send fields defined for this method; unknown fields are rejected before execution.

| Method | Field | Type | Requirement | Meaning | Enum or bound | Example |

| --- | --- | --- | --- | --- | --- | --- |

| GET | query | string | Required | Search terms | — | "咖啡" |

| GET | sort | string | Optional / conditional | Sort order: relevance, newest, most liked, most commented, most saved | ["relevance","latest","popular","most_comments","most_favorites"] | — |

| GET | type | string | Optional / conditional | Video notes only (video) or image notes only (image); both when left out | ["video","image"] | — |

| GET | published_within | string | Optional / conditional | Only those published in the last day, week or half year | ["day","week","half_year"] | — |

| GET | cursor | string | Optional / conditional | The `next_cursor` of the previous page. A new page is a new call. | — | — |

| GET | view | string | Optional / conditional | How much of each item: compact (the most used fields, long text cut short), standard, or full (adds `ext`). | ["compact","standard","full"] | — |

| GET | fields | array | Optional / conditional | Return only these fields of each item, by path (`author.name`). | maxItems: 64 | — |

## Complete one verification

Run one local fixture for a listed capability and inspect the object structure. Then filter, classify or export according to the question. A local sample cannot replace evidence for a real-platform conclusion.

```json
{
  "capability": "xiaohongshu.notes.search",
  "method": "GET",
  "params": {
    "query": "咖啡"
  }
}
```

## Related pages

- [Xiaohongshu note search](https://datanavoapi.com/en/apis/xiaohongshu/notes/search/)
- [Douyin video search](https://datanavoapi.com/en/apis/douyin/videos/search/)
- [X post search](https://datanavoapi.com/en/apis/x/posts/search/)
- [Post fields](https://datanavoapi.com/en/docs/objects/post/)
- [Query Douyin videos and accounts with Python](https://datanavoapi.com/en/guides/douyin-api-python/)
- [Search and organize X posts by keyword](https://datanavoapi.com/en/guides/x-search-posts-by-keyword/)
- [Read RedNote notes with Python](https://datanavoapi.com/en/guides/xiaohongshu-api-python/)
- [Search RedNote notes and export a table](https://datanavoapi.com/en/guides/xiaohongshu-search-export-notes/)

[中文](https://datanavoapi.com/answers/keyword-viral-content-ranking-api/)
