Skip to content

An API for getting trending content from various platforms 🌎

License

Notifications You must be signed in to change notification settings

Zivsteve/trendgetter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌎 Trendgetter

GitHub package.json version GitHub


Trendgetter is a free and open-source API that provides trending data from various platforms such as Google, YouTube, X, Reddit, GitHub, and TikTok.

You can clone this repository and run your own instance of the API.

πŸŽ‰ Trendgetter API 2.0 is here!

The Trendgetter API has been completely rewritten from scratch to provide a more robust and scalable solution for fetching trending data from multiple platforms. The new version includes improved error handling, better performance, and support for additional platforms.

Try it out now! https://trendgetter.vercel.app/


How to Use

  1. Clone the repository:

    git clone https://github.com/zivsteve/trendgetter.git
    cd trendgetter-api
    yarn
    yarn dev
  2. Set up environment variables:

    • Copy the .env.example file to .env and fill in any required API keys.
  3. Access the API endpoints:

    • The API will be running at http://localhost:3000 by default.
    • You can access the available endpoints as described below.

Available Platforms & Explanations:


Google

GET /api/google/topics

Get trending search topics from Google Trends.

Parameter Type Default Description
hl string en Language code (e.g., en, es, fr)
geo string US Geographic location code (e.g., US, GB, IN)
cat string ALL Category code for trends

Check the GoogleCategory enum for available categories.

Google Trends RSS Feed

Google provides an official RSS feed for trending search terms: https://trends.google.com/trending/rss


YouTube

GET /api/youtube/videos

Get trending videos from YouTube.

Parameter Type Default Description
region_code string US The region code for which to retrieve trending videos (e.g., US, GB, IN)
limit string 10 The maximum number of trending videos to retrieve.

YouTube Data API v3

Unfortunately, YouTube removed their official trending page in 2025.

However, you can still retrieve trending videos using the YouTube Data API v3: https://developers.google.com/youtube/v3/docs/videos/list


X (formerly Twitter)

GET /api/x/tags

Get trending hashtags from X (formerly Twitter).

Parameter Type Default Description
location string '' The location for which to retrieve trending hashtags (e.g., US, GB). Leave empty for worldwide.

Workaround for X's limited API

Unfortunately, X made their official API really expensive and limited access.

The platform also requires authentication for accessing trending topics.

A workaround is to scrape this third-party site that displays X's trending topics: https://trends24.in/


Reddit

GET /api/reddit/posts

Get trending posts from Reddit.

Parameter Type Default Description
subreddit string popular The subreddit from which to retrieve trending posts (e.g., popular, all, funny)
t string day The time range for trending posts. Can be 'hour', 'day', 'week', 'month', 'year', or 'all'.

Reddit API

Reddit has an amazing API. You can add .json to almost any page to get it's posts.

For example, the top posts of r/popular: https://www.reddit.com/r/popular/top.json


Hacker News / Y Combinator

GET /api/hackernews/posts

Get trending posts from Hacker News.

Parameter Type Default Description
type string top The type of trending posts to fetch. Can be 'top', 'new', or 'best'.
limit number 20 The maximum number of trending posts to retrieve.

Hacker News API

Hacker News provides a public API to fetch top, new, and best posts: https://github.com/HackerNews/API


Pinterest

GET /api/pinterest/pins

Get trending pins from Pinterest.

Parameter Type Default Description
countryCode string US The country code to fetch trending pins for (e.g., US, GB, IN)
category string ALL The category to filter trending pins by. Multiple values can be provided as an array.

Check the PinsCategory enum for available categories.

Pinterest's Unofficial API

Pinterest does provide an official API, but we can use their private API to fetch trending pins.

This is done by mimicking the requests made by the Pinterest web application: https://trends.pinterest.com


GitHub

GET /api/github/repos

Get trending repositories from GitHub.

Parameter Type Default Description
since string daily The time range for trending repositories. Can be 'daily', 'weekly', or 'monthly'.
language string '' The programming language to filter repositories by (e.g., 'javascript', 'python')
spoken_language_code string '' The spoken language to filter repositories by. (e.g., 'en' for English)

GitHub Trending Page

GitHub doesn't have an official API, but it has a trending page which we can parse: https://github.com/trending

We can also get trending developers: https://github.com/trending/developers


TikTok

GET /api/tiktok/videos

Get trending videos from TikTok.

Parameter Type Default Description
period number 7 The time period (in days) to retrieve trending videos for. Can be 1, 7, or 30.
page number 1 The page number of results to retrieve.
limit number 10 The maximum number of trending videos to retrieve per page.
country_code string US The country code for which to retrieve trending videos (e.g., US, GB, IN)

TikTok's Unofficial API

TikTok does not provide an official API for trending videos.

However, we can use TikTok's internal API endpoints from their Creative Center to fetch trending videos by mimicking the requests made by the TikTok web application.

https://ads.tiktok.com/business/creativecenter/inspiration/popular/pc/en


Donate

Help me improve this project! Any amount is much appreciated :)

Buy Me A Coffee

License

Copyright (C) 2020-present Zivsteve.
Licensed under the MIT license.
(See the LICENSE file for the whole license text.)

Contributing

Feel free to open issues or submit pull requests for improvements or new features!

About

An API for getting trending content from various platforms 🌎

Topics

Resources

License

Stars

Watchers

Forks