100 free credits. No credit card required.Start building
Logo
Back to blog

Social Media Trends API: What's Trending by Country

··9 min read

A social media trends API for one country: TikTok breakout posts, sounds, hashtags and Google searches, plus Pinterest, Apple Music and Product Hunt data.

Social Media Trends API: What's Trending by Country

To see what is trending in a country through an API, call GET /v1/prism/trend-board?country_code=US. It returns TikTok breakout posts, the most used sounds, TikTok's trending hashtags and Google's trending searches for that country, with no keyword needed. Pinterest Trends, Apple Music charts and Product Hunt launches are separate endpoints, and each takes its own country parameter or none.

CallCountry parameterCreditsWhat you get
GET /v1/prism/trend-boardcountry_code30 flatBreakout TikTok posts, sounds, hashtags, Google searches
GET /v1/pinterest/trendscountry10Growing, seasonal or top Pinterest search terms
GET /v1/apple_music/chartscountry1The country's Apple Music chart
GET /v1/producthunt/launchesnone1Current Product Hunt launches, filterable by topic
An open case holds four trays from a social media trends api board: one short-video frame, a stack of sound discs, blank tag pins, and search cards.

What does the trend board return for a country?

The trend board is a live scan of one country, built per call from TikTok's local feed, TikTok's hashtag board and Google Trending Now. It returns four sections: breakout_posts, rising_sounds, rising_hashtags and rising_searches. Nothing is stored between calls, so there is no history and no days parameter. It is a Prism composite, listed under Prism.

bash
curl "https://www.socialcrawl.dev/v1/prism/trend-board?country_code=US&limit=3" \
  -H "x-api-key: $SOCIALCRAWL_API_KEY"
ParameterMeaning
country_codeRequired. An ISO 3166-1 code that Google Trends covers, such as US, DE or KR. An unsupported code is a free 400.
period7 (default) or 30. The window of TikTok's hashtag board. Google Trending Now is always read over its longest window, 7 days.
limitRows per section, 1 to 10. Default 10.

The four sections work like this:

  • Breakout posts are videos on TikTok's local feed for that country whose views are at least 3 times the median of the author's own recent posts. Pinned posts and posts under 48 hours old are left out, and at least 8 posts must be compared.
  • Rising sounds are the sounds used most on that feed, with how many of each sound's first page of videos are from the last 3 days, and whether the sound is new or returning.
  • Rising hashtags come from TikTok's own hashtag board for the country, with growth measured from its daily popularity curve. TikTok's hashtag board covers 27 markets. Elsewhere that section is empty and says why.
  • Rising searches are Google Trends Trending Now, with Google's own start time as the first-seen date.

A breakout row carries the author, the post URL, views, published_at, and vs_creator, the ratio of the post's views to that author's median:

json
{
  "author": "<handle>",
  "url": "https://www.tiktok.com/@<handle>/video/<id>",
  "region": "US",
  "views": 4634696,
  "vs_creator": 3315.23,
  "author_median_views": 1398,
  "author_posts_compared": 9
}

There is no caption, likes or comment count on a breakout row, so fetch the video if you need them. sources and unavailable in the response say which parts answered. A source that fails leaves its section empty, and only a call where the feed, the hashtag board and Google Trending Now all fail is refunded.

A fresh board takes real time because it reads the local feed first. Set a generous client timeout, and expect a repeat call within 15 minutes to be served from cache.

GET /v1/pinterest/trends returns what people in one market are searching for on Pinterest, with no keyword in. It takes country (default US) and type, and costs 10 credits whatever the limit.

bash
curl "https://www.socialcrawl.dev/v1/pinterest/trends?country=US&type=growing&limit=5" \
  -H "x-api-key: $SOCIALCRAWL_API_KEY"

type picks the table:

typeReturns
growing (default)Terms rising fastest
seasonalTerms that come back at this time every year
top_monthlyThe most searched terms of the month
top_yearlyThe most searched terms of the year

Each item has rank, term, search_index, weekly_change, monthly_change, yearly_change, seasonality and as_of. Reading the fields:

  • search_index is relative search volume from 0 to 100 within the answer.
  • The change fields are fractions, so 0.3 means +30%. Pinterest reports 100.01 for a term that was near zero before.
  • as_of is the date of Pinterest's weekly data. Pinterest publishes weekly, so the list is never current to the minute.

limit runs 1 to 50 with a default of 25. Pinterest publishes lists for 23 countries, including KR, DE, GB and BR; any other code is a free 400. Ireland reads the GB and IE list, and Australia and New Zealand share one. For retrieval options beyond this endpoint, see Pinterest data APIs.

Three push-pins of different heights stand on a board, a stand-in for growing Pinterest Trends rows.

How do you get Apple Music charts for a country?

GET /v1/apple_music/charts returns the chart of what a country plays most on Apple Music, ranked from the top. It takes country in any case (default us), type and limit, and costs 1 credit.

bash
curl "https://www.socialcrawl.dev/v1/apple_music/charts?country=de&type=songs&limit=10" \
  -H "x-api-key: $SOCIALCRAWL_API_KEY"

type is songs (default), albums, music-videos or playlists. limit runs 1 to 100 with a default of 50, and the chart has one page. Each item is a post: content.text is the title, author.username the artist, url the Apple Music link, and ext.trend.rank the chart position (1 is the top). published_at is the release date at midnight UTC. Playlists have no artist or release date. A country with no published chart is a free 400, and Apple refreshes the chart about once a day, so an hourly poll is plenty.

The chart gives a rank, not play counts, so computed.engagement_rate and computed.estimated_reach are null. To follow one song across platforms, see the music trend detection recipe.

What does Product Hunt return without a country?

GET /v1/producthunt/launches returns the launches Product Hunt is currently featuring, roughly 50, for 1 credit. It has no country parameter, so it is a global list. Add topic with a Product Hunt topic slug such as developer-tools to narrow it, or query to filter by product name and tagline.

bash
curl "https://www.socialcrawl.dev/v1/producthunt/launches?topic=developer-tools" \
  -H "x-api-key: $SOCIALCRAWL_API_KEY"

Each row has the product name in post.ext.title, the tagline in post.content.text, the product page URL, the maker's display name, and post.published_at, which is when the post was created and can be weeks before its launch day. The order is the feed's own and carries no vote ranking. Votes, comments and maker handles are not available, so engagement fields are null, which means not measured, not zero.

How do you make your first call?

  1. Create a key at signup. New accounts get 100 free credits.
  2. Send the trend-board request above with your country code. A full set of all four calls costs 42 credits, 30 of them the board.
  3. Use the explorer to see responses before writing code, and the Prism docs, Pinterest docs, Apple Music docs and Product Hunt docs for every parameter.

For a Google Trends client on its own, read Google Trends API.

Frequently asked questions

country_code on the trend board returns four sections for that country: TikTok breakout posts, rising sounds, rising hashtags and Google trending searches. It costs 30 credits flat. Pinterest, Apple Music and Product Hunt are separate endpoints and are not in that response.

Does the trend board keep a history?

No. It is computed live on each call and keeps nothing between calls, so there is no history and no days parameter. A repeat call within 15 minutes is served from cache. To track change over time, save each response yourself.

What does the period parameter change?

period sets the window of TikTok's hashtag board, 7 or 30 days. Google Trending Now is always read over its longest window, 7 days, whichever you choose.

Yes, both take country, and neither uses country_code. Pinterest defaults to US and Apple Music to us. A country without a published list or chart is a free 400.

Does Product Hunt filter launches by country?

No. The launches endpoint has no country parameter. You can narrow by topic or filter by query. Votes and comments are not available on it.

Topics
#social-media-trends-api#tiktok-trends-api#trending-topics-api#pinterest-trends#apple-music-charts-api#what's-trending-on-social-media

Related posts

🤖 AI agent or LLM? Read this page as markdown