### Get Trending Articles Request Source: https://newsmesh.co/docs Example cURL request for the /v1/trending endpoint. ```bash $ curl "https://api.newsmesh.co/v1/trending?apiKey=nm_xxx&limit=10" ``` -------------------------------- ### Get Latest Articles Requests Source: https://newsmesh.co/docs Examples of various cURL requests for the /v1/latest endpoint, including filtering by category and country. ```bash # Get latest 10 articles $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&limit=10" # Get sports articles $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&category=sports" # Filter by multiple categories $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&category=politics,business" # Get news about events in the US $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&country=us" # Get news about multiple countries $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&country=us,gb,ca" # Combine country and category filters $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&country=us&category=politics" ``` -------------------------------- ### Get Trending Articles Response Source: https://newsmesh.co/docs Example JSON response structure for the /v1/trending endpoint. ```json { "data": [ { "article_id": "4d5a309dfceb13e6fdb34fd1410fe22e", "title": "Cuomo rips Mamdani's freebie 'fantasy,' says AOC proved socialism fails", "description": "Former Gov. Andrew Cuomo and Zohran Mamdani clashed over economic policies.", "link": "https://www.foxnews.com/politics/cuomo-rips-mamdanis-freebie-fantasy", "media_url": "https://a57.foxnews.com/static.foxnews.com/.../cuomo.png", "published_date": "2025-10-08T18:35:50+00:00", "source": "Fox News", "category": "politics", "topics": ["economic policies", "governance", "socialism"], "people": ["Andrew Cuomo", "Zohran Mamdani", "AOC"], "author": ["Jane Smith"] } ] } ``` -------------------------------- ### GET /v1/article/{article_id} Source: https://newsmesh.co/docs Get a specific article by its unique identifier. ```APIDOC ## GET /v1/article/{article_id} ### Description Get a specific article by its ID. ### Method GET ### Endpoint /v1/article/{article_id} ### Parameters #### Path Parameters - **article_id** (string) - Required - Unique article identifier. ### Request Example ``` $ curl "https://api.newsmesh.co/v1/article/4c213ea447c9773981780776c9b7399b?apiKey=nm_xxx" ``` ### Response No response schema provided in the source. ``` -------------------------------- ### Get Single Article with curl Source: https://newsmesh.co/docs Curl command for the /v1/article/{article_id} endpoint to retrieve a specific article by its ID. Replace the article_id in the URL with the actual article identifier. ```bash $ curl "https://api.newsmesh.co/v1/article/4c213ea447c9773981780776c9b7399b?apiKey=nm_xxx" ``` -------------------------------- ### GET /v1/trending Source: https://newsmesh.co/docs Retrieves trending articles from a curated feed. The response is cached for fast performance. ```APIDOC ## GET /v1/trending ### Description Get trending articles from a curated feed (cached, fast response). ### Method GET ### Endpoint /v1/trending ### Parameters #### Query Parameters - **apiKey** (string) - Required - API key for authentication. - **limit** (integer) - Optional - Number of articles to return. Default: 10. Max: 10 on Free & Starter, max: 25 on Growth & Pro. ### Response #### Success Response (200) - **data** (array) - Array of article objects. - **article_id** (string) - Unique article identifier. - **title** (string) - Article headline. - **description** (string) - Brief summary. - **link** (string) - Original article URL. - **media_url** (string) - Featured image URL. - **published_date** (string) - ISO 8601 timestamp. - **source** (string) - News outlet name. - **category** (string) - Article category. - **topics** (array) - Array of related topics. - **people** (array) - Array of people mentioned. - **author** (array) - Array of article authors (or null if unavailable). #### Response Example { "data": [ { "article_id": "4d5a309dfceb13e6fdb34fd1410fe22e", "title": "Cuomo rips Mamdani's freebie 'fantasy,' says AOC proved socialism fails", "description": "Former Gov. Andrew Cuomo and Zohran Mamdani clashed over economic policies.", "link": "https://www.foxnews.com/politics/cuomo-rips-mamdanis-freebie-fantasy", "media_url": "https://a57.foxnews.com/static.foxnews.com/.../cuomo.png", "published_date": "2025-10-08T18:35:50+00:00", "source": "Fox News", "category": "politics", "topics": ["economic policies", "governance", "socialism"], "people": ["Andrew Cuomo", "Zohran Mamdani", "AOC"],".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".". ``` -------------------------------- ### GET /v1/search Source: https://newsmesh.co/docs Search articles by keyword with optional date filtering and sorting. Supports advanced query syntax including phrases, exclusions, and boolean operators. Word forms are matched automatically. ```APIDOC ## GET /v1/search ### Description Search articles by keyword with optional date filtering and sorting. Supports advanced query syntax including phrases, exclusions, and boolean operators. Word forms are matched automatically (e.g., "walk" matches "walking", "walked"). ### Method GET ### Endpoint /v1/search ### Parameters #### Query Parameters - **apiKey** (string) - Required - API key for authentication. - **q** (string) - Required - Search query. Supports: "phrase", -exclude, AND, OR. - **searchIn** (string) - Optional - Fields to search: title, description. - **from** (string) - Optional - Start date YYYY-MM-DD. - **to** (string) - Optional - End date YYYY-MM-DD. - **category** (string) - Optional - Filter by category (comma-separated). - **sources** (string) - Optional - Include only specific sources by domain URL (e.g., nytimes.com, wsj.com). - **excludeSources** (string) - Optional - Exclude specific sources by domain URL. - **country** (string) - Optional - Filter by content relevance (ISO codes: us, gb, ca). - **sourceCountry** (string) - Optional - Filter by news outlet's country (ISO codes: us, gb, ca). - **limit** (integer) - Optional - Default: 10, max: 10 on Free & Starter, max: 25 on Growth & Pro. - **sortBy** (string) - Optional - Default: date_descending. Options: date_descending, date_ascending, relevant. - **cursor** (string) - Optional - Pagination cursor. ### Sort Options - **date_descending** - Newest first (default) - **date_ascending** - Oldest first - **relevant** - Most relevant to search query ### Request Example ``` # Basic search $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=climate" # Phrase search (exact match) $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=\"climate change\"" # Exclude terms $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=bitcoin+-scam" # OR search (either term matches) $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=tennis+OR+golf" # Filter by source $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=news&sources=nytimes.com,wsj.com" # Search with date range $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=election&from=2025-10-01&to=2025-10-05" ``` ### Response No response schema provided in the source. ``` -------------------------------- ### Pagination with cURL Source: https://newsmesh.co/docs Demonstrates how to perform cursor-based pagination by using the next_cursor value from the initial request in subsequent calls. ```bash # Page 1 $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&limit=25" # Page 2 (using cursor from previous response) $ curl "https://api.newsmesh.co/v1/latest?apiKey=nm_xxx&limit=25&cursor=eyJwdWJsaXNoZWRfZGF0ZSI6..." ``` -------------------------------- ### Search Articles with curl - Basic and Advanced Queries Source: https://newsmesh.co/docs Curl commands for the /v1/search endpoint demonstrating basic keyword search, phrase search, term exclusion, OR operator, source filtering, and date range filtering. Use apiKey=nm_xxx as a placeholder for your API key. ```bash # Basic search $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=climate" # Phrase search (exact match) $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=\"climate change\"" # Exclude terms $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=bitcoin+-scam" # OR search (either term matches) $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=tennis+OR+golf" # Filter by source $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=news&sources=nytimes.com,wsj.com" # Search with date range $ curl "https://api.newsmesh.co/v1/search?apiKey=nm_xxx&q=election&from=2025-10-01&to=2025-10-05" ``` -------------------------------- ### Authentication Query Parameter Source: https://newsmesh.co/docs All API endpoints require an API key passed as a query parameter. ```text ?apiKey=your_api_key_here ``` -------------------------------- ### Rate Limit Response Headers Source: https://newsmesh.co/docs Every API response includes these headers to track per-second and daily account usage. ```http X-RateLimit-Limit: 5 X-RateLimit-Remaining: 4 X-RateLimit-Reset: 1 X-Account-RateLimit-Limit: 10000 X-Account-RateLimit-Remaining: 9847 X-Account-RateLimit-Reset: 1735689600 ``` -------------------------------- ### API Base URL Source: https://newsmesh.co/docs The base URL for all API requests. ```text https://api.newsmesh.co/v1 ``` -------------------------------- ### Standard Error Response Format Source: https://newsmesh.co/docs All API endpoints return errors using this consistent JSON structure. ```json { "status": "error", "code": "errorCodeInCamelCase", "message": "Human-readable error description." } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.