Back to Home

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:

SyntaxDescriptionExample
"phrase"Exact phrase matchq="climate change"
-termExclude term from resultsq=bitcoin -scam
ANDBoth terms required (default behavior)q=tesla AND electric
OREither term matchesq=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

ParameterRequiredDescription
qYesSearch query (supports phrases, exclusions, AND/OR)
searchInNoFields to search: title, description (comma-separated)
fromNoStart date (YYYY-MM-DD)
toNoEnd date (YYYY-MM-DD)
categoryNoFilter by category (comma-separated, max 10)
sourcesNoInclude only specific sources (comma-separated, max 10)
excludeSourcesNoExclude specific sources (comma-separated, max 10)
countryNoFilter by content relevance (ISO codes: us, gb, ca, etc.)
sourceCountryNoFilter by news outlet's country (ISO codes: us, gb, ca, etc.)
sortByNoSort order: date_descending, date_ascending, relevant
limitNoResults per page (default: 10, max: 10 on Free & Starter, max: 25 on Growth & Pro)
cursorNoPagination cursor from previous response

Available Categories

Filter your search results by one or more categories:

politicstechnologybusinesshealthentertainmentsportssciencelifestyleenvironmentworld

Code 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

FeatureFreeStarterProAdvanced
Search endpoint
Date range filtering
Searchable history7 days7 days6 monthsFull archive
Get Started View Full Docs