### Install Trendgetter Core with npm Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Install the Trendgetter core package using npm. ```bash npm install @trendgetter/core ``` -------------------------------- ### Clone and Run Trendgetter API Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Clone the Trendgetter repository, install dependencies, and start the development server. Ensure environment variables are configured. ```bash git clone https://github.com/zivsteve/trendgetter.git cd trendgetter-api yarn yarn dev ``` -------------------------------- ### Install Trendgetter Core with yarn Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Install the Trendgetter core package using yarn. ```bash yarn add @trendgetter/core ``` -------------------------------- ### GET /api/hackernews/posts Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Get trending posts from Hacker News / Y Combinator. ```APIDOC ## GET /api/hackernews/posts ### Description Get trending posts from Hacker News. ### Method GET ### Endpoint /api/hackernews/posts ``` -------------------------------- ### GET /api/x/tags Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Get trending hashtags from X (formerly Twitter). Supports filtering by location. ```APIDOC ## GET /api/x/tags ### Description Get trending hashtags from X (formerly Twitter). Supports filtering by location. ### Method GET ### Endpoint /api/x/tags ### Parameters #### Query Parameters - **location** (string) - Optional - The location for which to retrieve trending hashtags (e.g., `US`, `GB`). Leave empty for worldwide. ``` -------------------------------- ### GET /api/youtube/videos Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Get trending videos from YouTube. Allows specifying the region code and the number of videos to retrieve. ```APIDOC ## GET /api/youtube/videos ### Description Get trending videos from YouTube. Allows specifying the region code and the number of videos to retrieve. ### Method GET ### Endpoint /api/youtube/videos ### Parameters #### Query Parameters - **region_code** (string) - Optional - The region code for which to retrieve trending videos (e.g., `US`, `GB`, `IN`) - **limit** (string) - Optional - The maximum number of trending videos to retrieve. ``` -------------------------------- ### Fetch YouTube Videos with Parameters Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Customize YouTube video requests using the optional `params` object. For example, specify region code and maximum results. ```typescript const results = await trendgetter.youtube.videos({ regionCode: 'GB', maxResults: 5 }); console.log(results); ``` -------------------------------- ### Get trending repositories from GitHub Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Fetches trending repositories from GitHub, allowing filtering by time range, programming language, and spoken language. ```APIDOC ## GET /api/github/repos ### Description Get trending repositories from GitHub. ### Method GET ### Endpoint /api/github/repos ### Parameters #### Query Parameters - **since** (string) - Optional - The time range for trending repositories. Can be 'daily', 'weekly', or 'monthly'. Defaults to `daily`. - **language** (string) - Optional - The programming language to filter repositories by (e.g., 'javascript', 'python'). Defaults to `''`. - **spoken_language_code** (string) - Optional - The spoken language to filter repositories by. (e.g., 'en' for English). Defaults to `''`. ### Request Example ```json { "since": "weekly", "language": "python" } ``` ### Response #### Success Response (200) - **repositories** (array) - A list of trending repositories. - **repositories[].name** (string) - The name of the repository. - **repositories[].url** (string) - The URL of the repository. - **repositories[].description** (string) - The description of the repository. - **repositories[].language** (string) - The primary programming language of the repository. #### Response Example ```json { "repositories": [ { "name": "Awesome Project", "url": "https://github.com/user/repo", "description": "A cool project that does amazing things.", "language": "Python" } ] } ``` ``` -------------------------------- ### Get trending pins from Pinterest Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Fetches trending pins from Pinterest, allowing filtering by country and category. ```APIDOC ## GET /api/pinterest/pins ### Description Get trending pins from Pinterest. ### Method GET ### Endpoint /api/pinterest/pins ### Parameters #### Query Parameters - **countryCode** (string) - Optional - The country code to fetch trending pins for (e.g., `US`, `GB`, `IN`). Defaults to `US`. - **category** (string) - Optional - The category to filter trending pins by. Multiple values can be provided as an array. Defaults to `ALL`. ### Request Example ```json { "countryCode": "US", "category": ["FASHION", "HOME"] } ``` ### Response #### Success Response (200) - **pins** (array) - A list of trending pins. - **pins[].title** (string) - The title of the pin. - **pins[].url** (string) - The URL of the pin. - **pins[].image_url** (string) - The URL of the pin's image. #### Response Example ```json { "pins": [ { "title": "Summer Fashion Trends", "url": "https://www.pinterest.com/pin/1234567890/", "image_url": "https://i.pinimg.com/564/abc.jpg" } ] } ``` ``` -------------------------------- ### GET /api/google/topics Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Get trending search topics from Google Trends. Supports filtering by language, geographic location, and category. ```APIDOC ## GET /api/google/topics ### Description Get trending search topics from Google Trends. Supports filtering by language, geographic location, and category. ### Method GET ### Endpoint /api/google/topics ### Parameters #### Query Parameters - **hl** (string) - Optional - Language code (e.g., `en`, `es`, `fr`) - **geo** (string) - Optional - Geographic location code (e.g., `US`, `GB`, `IN`) - **cat** (string) - Optional - Category code for trends. Check the `GoogleCategory` enum for available categories. ``` -------------------------------- ### GET /api/reddit/posts Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Get trending posts from Reddit. Allows specifying the subreddit and time range. ```APIDOC ## GET /api/reddit/posts ### Description Get trending posts from Reddit. Allows specifying the subreddit and time range. ### Method GET ### Endpoint /api/reddit/posts ### Parameters #### Query Parameters - **subreddit** (string) - Optional - The subreddit from which to retrieve trending posts (e.g., `popular`, `all`, `funny`) - **t** (string) - Optional - The time range for trending posts. Can be 'hour', 'day', 'week', 'month', 'year', or 'all'. ``` -------------------------------- ### Get trending videos from TikTok Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Fetches trending videos from TikTok, allowing filtering by period, page, limit, and country code. ```APIDOC ## GET /api/tiktok/videos ### Description Get trending videos from TikTok. ### Method GET ### Endpoint /api/tiktok/videos ### Parameters #### Query Parameters - **period** (number) - Optional - The time period (in days) to retrieve trending videos for. Can be 1, 7, or 30. Defaults to `7`. - **page** (number) - Optional - The page number of results to retrieve. Defaults to `1`. - **limit** (number) - Optional - The maximum number of trending videos to retrieve per page. Defaults to `10`. - **country_code** (string) - Optional - The country code for which to retrieve trending videos (e.g., `US`, `GB`, `IN`). Defaults to `US`. ### Request Example ```json { "period": 30, "page": 2, "limit": 20, "country_code": "GB" } ``` ### Response #### Success Response (200) - **videos** (array) - A list of trending videos. - **videos[].id** (string) - The unique identifier of the video. - **videos[].description** (string) - The description of the video. - **videos[].url** (string) - The URL of the video. - **videos[].author** (object) - Information about the video's author. - **videos[].author.name** (string) - The name of the author. - **videos[].author.url** (string) - The URL of the author's profile. #### Response Example ```json { "videos": [ { "id": "video123", "description": "A funny cat video!", "url": "https://www.tiktok.com/video/1234567890", "author": { "name": "CatLover", "url": "https://www.tiktok.com/@catlover" } } ] } ``` ``` -------------------------------- ### List Available Platform Methods Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Demonstrates the available methods for fetching trending data from various platforms. ```typescript trendgetter.github.repos(); trendgetter.google.topics(); trendgetter.hackernews.posts(); trendgetter.pinterest.pins(); trendgetter.reddit.posts(); trendgetter.tiktok.videos(); trendgetter.x.tags(); trendgetter.youtube.videos(); ``` -------------------------------- ### Fetch YouTube Trending Videos Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Fetch trending videos from YouTube. Ensure the package is imported. ```typescript const results = await trendgetter.youtube.videos(); console.log(results); ``` -------------------------------- ### Set YouTube API Key Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Configure an API key for platforms that require authentication, such as YouTube. Environment variables are automatically detected if set. ```typescript trendgetter.youtube.apiKey = 'YOUTUBE_API_KEY'; ``` -------------------------------- ### Import Trendgetter Package Source: https://github.com/zivsteve/trendgetter/blob/main/packages/core/README.md Import the Trendgetter package into your TypeScript project. ```typescript import * as trendgetter from '@trendgetter/core'; ``` -------------------------------- ### Fetch Google Trending Topics Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Retrieve trending search topics from Google Trends. Supports filtering by language, geography, and category. ```http GET /api/google/topics?hl=en&geo=US&cat=ALL ``` -------------------------------- ### Fetch YouTube Trending Videos Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Retrieve trending videos from YouTube. Supports filtering by region and limiting the number of results. ```http GET /api/youtube/videos?region_code=US&limit=10 ``` -------------------------------- ### Fetch X (Twitter) Trending Hashtags Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Retrieve trending hashtags from X (formerly Twitter). Supports filtering by location. ```http GET /api/x/tags?location=US ``` -------------------------------- ### Fetch Hacker News Trending Posts Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Retrieve trending posts from Hacker News (Y Combinator). ```http GET /api/hackernews/posts ``` -------------------------------- ### Fetch Reddit Trending Posts Source: https://github.com/zivsteve/trendgetter/blob/main/README.md Retrieve trending posts from Reddit. Supports filtering by subreddit and time range. ```http GET /api/reddit/posts?subreddit=popular&t=day ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.