Advanced Search
Search millions of articles with powerful filters and sorting options.
Overview
NewsMesh's search endpoint lets you find articles across our entire database using keyword queries. Combine keywords with filters like date ranges, categories, and sorting to find exactly what you need.
Search queries match against article titles and descriptions, returning results ranked by relevance or sorted by date. With cursor-based pagination, you can efficiently retrieve large result sets.
Advanced Query Syntax
The search query supports advanced operators for precise results:
| Syntax | Description | Example |
|---|---|---|
"phrase" | Exact phrase match | q="climate change" |
-term | Exclude term from results | q=bitcoin -scam |
AND | Both terms required (default behavior) | q=tesla AND electric |
OR | Either term matches | q=tennis OR golf |
Word variations: The search automatically handles different word forms — a search for "walk" will also match "walking", "walked", and "walks".
Query Parameters
| Parameter | Required | Description |
|---|---|---|
q | Yes | Search query (supports phrases, exclusions, AND/OR) |
searchIn | No | Fields to search: title, description (comma-separated) |
from | No | Start date (YYYY-MM-DD) |
to | No | End date (YYYY-MM-DD) |
category | No | Filter by category (comma-separated, max 10) |
sources | No | Include only specific sources (comma-separated, max 10) |
excludeSources | No | Exclude specific sources (comma-separated, max 10) |
country | No | Filter by content relevance (ISO codes: us, gb, ca, etc.) |
sourceCountry | No | Filter by news outlet's country (ISO codes: us, gb, ca, etc.) |
sortBy | No | Sort order: date_descending, date_ascending, relevant |
limit | No | Results per page (default: 10, max: 10 on Free & Starter, max: 25 on Growth & Pro) |
cursor | No | Pagination cursor from previous response |
Available Categories
Filter your search results by one or more categories:
politicstechnologybusinesshealthentertainmentsportssciencelifestyleenvironmentworldCode Examples
Basic keyword search:
$ curl "https://api.newsmesh.co/v1/search?q=climate&apiKey=YOUR_API_KEY"
Phrase search (exact match):
$ curl "https://api.newsmesh.co/v1/search?q="climate change"&apiKey=YOUR_API_KEY"
Exclude terms:
$ curl "https://api.newsmesh.co/v1/search?q=crypto+-scam&apiKey=YOUR_API_KEY"
OR search (either term):
$ curl "https://api.newsmesh.co/v1/search?q=tennis+OR+golf&apiKey=YOUR_API_KEY"
Search title only:
$ curl "https://api.newsmesh.co/v1/search?q=technology&searchIn=title&apiKey=YOUR_API_KEY"
Filter by source:
$ curl "https://api.newsmesh.co/v1/search?q=news&sources=BBC,Reuters&apiKey=YOUR_API_KEY"
Search with date range:
$ curl "https://api.newsmesh.co/v1/search?q=election&from=2025-01-01&to=2025-12-31&apiKey=YOUR_API_KEY"
Search within specific categories:
$ curl "https://api.newsmesh.co/v1/search?q=startup&category=technology,business&apiKey=YOUR_API_KEY"
Example Response
{ "data": [ { "article_id": "abc123def456", "title": "Climate Summit Reaches Historic Agreement", "description": "World leaders agree on ambitious emissions targets...", "link": "https://example.com/article", "media_url": "https://example.com/image.jpg", "published_date": "2025-12-20T14:30:00Z", "source": "Global News", "category": "environment", "topics": ["climate", "emissions", "policy"], "people": [], "author": ["Jane Doe"] } ], "next_cursor": "eyJwdWJsaXNoZWRfZGF0ZSI6..." }
Plan Availability
| Feature | Free | Starter | Pro | Advanced |
|---|---|---|---|---|
| Search endpoint | ✓ | ✓ | ✓ | ✓ |
| Date range filtering | ✓ | ✓ | ✓ | ✓ |
| Searchable history | 7 days | 7 days | 6 months | Full archive |