Skip to content

Parameters by endpoint

Lucene query

INFO

The News API supports the Lucene query syntax for searching articles. You can use the q parameter to specify the Lucene query. The Lucene query syntax allows you to search articles based on the keywords, phrases, and operators you specify in the query. For example, you can search for articles that contain the keyword Bitcoin in the title or content.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
qThe Lucene query to search for articles.stringNoBitcoin

Lucene query syntax

You can use the following Lucene query syntax to search for articles:

SyntaxDescription
keywordThe keyword to search for.
ANDThe logical AND operator.
ORThe logical OR operator.
NOTThe logical NOT operator.
+The required operator.
-The prohibited operator.
()The grouping operator.
""The phrase operator.
*The wildcard operator.
?The single-character wildcard operator.
~The fuzzy operator.
^The boost operator.
field:valueThe field operator.
field:(value)The field grouping operator.
field:[value TO value]The range operator.

Workflow examples

Request to search for articles containing the keyword "Bitcoin":
shell
curl -X GET "https://api.apitube.io/v1/news/everything?q=Bitcoin&api_key=YOUR_API_KEY"
Request to search for articles containing the keyword "Bitcoin" and "Ethereum":
shell
curl -X GET "https://api.apitube.io/v1/news/everything?q=Bitcoin AND Ethereum&api_key=YOUR_API_KEY"
Request to search for articles containing the keyword "Bitcoin" or "Ethereum":
shell
curl -X GET "https://api.apitube.io/v1/news/everything?q=Bitcoin OR Ethereum&api_key=YOUR_API_KEY"

Datetime

With the News API, you can specify the date range of the articles you want to retrieve. You can use the published_at.start and published_at.end parameters to specify the date range. The date range is inclusive, meaning that the articles published on the from date and the to date are included in the result.

All datetime math functions using AQL format.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
published_at.startThe start date of the date range.stringNo2022-01-01
published_at.endThe end date of the date range.stringNo2022-01-31
published_atThe date of the articles you want to retrieve.stringNo2022-01-01

Date Math Keywords

You can use the following date math keywords to specify the date range:

KeywordDescription
NOWThe current date and time.
YEARThe current year.
MONTHThe current month.
DAYThe current day.
HOURThe current hour.
MINUTEThe current minute.
SECONDThe current second.

Date Formats

You can use the following date formats to specify the date range:

ExampleDescription
2006-01-02T15:04:05ZThe date and time in the YYYY-MM-DDTHH:MM:SSZ format.
2006-01-02The date in the YYYY-MM-DD format.
02-01-2006The date in the DD-MM-YYYY format.
2006-01-02T15:04:05-07:00The date and time in the YYYY-MM-DDTHH:MM:SSZ format.
2006-01-02T15:04:05.000ZThe date and time in the YYYY-MM-DDTHH:MM:SS.MMMZ format.
Mon, 02 Jan 2006 15:04:05 MSTThe date and time in the D, DD MMM YYYY HH:MM:SS Z format.
2006-01-02T15:04:05-07:00The date and time in the YYYY-MM-DDTHH:MM:SSZ format.
2006-01-02T15:04:05Z07:00The date and time in the YYYY-MM-DDTHH:MM:SSZ07:00 format. RFC3339 without the T separator.
Mon, 02 Jan 2006 15:04:05 -0700The date and time in the D, DD MMM YYYY HH:MM:SS Z format. For example, Mon, 02 Jan 2006 15:04:05 -0700.

Date Math

You can use the date math syntax to specify the date range. The date math syntax allows you to specify the date range relative to the current date and time. For example, you can specify the date range as NOW-1D to retrieve the articles published in the last 24 hours.

Date Math Syntax

You can use the following date math syntax to specify the date range:

SyntaxDescription
NOWThe current date and time.
NOW-1HThe current date and time minus one hour.
NOW-1DThe current date and time minus one day.
NOW-1MThe current date and time minus one month.
NOW-1YThe current date and time minus one year.
NOW+1HThe current date and time plus one hour.
YEARThe current year.
MONTHThe current month.
DAYThe current day.
HOURThe current hour.
MINUTEThe current minute.
SECONDThe current second.

Examples

ParameterDescription
NOW-2MONTHSThe current date and time minus two months.
NOW-1MONTHThe current date and time minus one month.
NOW-1WEEKThe current date and time minus one week.
NOW-1DAY/HOURThe current date and time minus one day and one hour.
NOW-1DAYThe current date and time minus one day.
NOW-1DAY/DAYYesterday.

Workflow examples

Request to get news articles within a specific date range:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=2022-01-01&published_at.end=2022-01-31&api_key=YOUR_API_KEY"
Request to get news using a relative time range:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=NOW-1D&published_at.end=NOW&api_key=YOUR_API_KEY"

Languages

APITube has 60+ more languages available for the News API. You can specify the language of the articles you want to retrieve.

List of supported languages

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
languageThe language of the articles you want to retrieve.stringNoen
ignore.languageThe language of the articles you want to exclude.stringNofr
language.idThe language ID of the articles you want to retrieve.stringNo314
ignore.language.idThe language ID of the articles you want to exclude.stringNo315
language.codeThe language code of the articles you want to retrieve.stringNoen
ignore.language.codeThe language code of the articles you want to exclude.stringNofr
language.nameThe language name of the articles you want to retrieve.stringNoEnglish
ignore.language.nameThe language name of the articles you want to exclude.stringNoFrench

Workflow examples

Request to get news articles excluding those from France and in the French language:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?ignore.country.code=fr&ignore.language.code=fr&api_key=YOUR_API_KEY"
Request to get news articles in the English and French languages:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?language.code=en,fr&api_key=YOUR_API_KEY"

Countries

APITube has 177 more countries available for the News API. You can specify the country of the articles you want to retrieve.

List of supported countries

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
source.country.idThe country ID of the articles you want to retrieve.stringNo314
ignore.country.idThe country ID of the articles you want to exclude.stringNo315
source.country.codeThe country code of the articles you want to retrieve.stringNous
ignore.country.codeThe country code of the articles you want to exclude.stringNofr
source.country.nameThe country name of the articles you want to retrieve.stringNoDenmark
ignore.country.nameThe country name of the articles you want to exclude.stringNoFrance

Workflow examples

Request to get news articles from the United States:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.country.code=us&api_key=YOUR_API_KEY"
Request to get news articles from the United States and Canada:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.country.code=us,ca&api_key=YOUR_API_KEY"
Request to get news articles excluding those from France and in the French language:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?ignore.country.code=fr&ignore.language.code=fr&api_key=YOUR_API_KEY"

Sentiment

Get articles with a specific sentiment score.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

By sentiment score

You can use the sentiment.overall.score parameter to specify the overall sentiment score of the articles you want to retrieve.

Parameters

ParameterDescriptionTypeRequiredExample
sentiment.overall.scoreThe overall sentiment score of the articles.floatNo0.2
sentiment.overall.score.minThe overall sentiment score of the articles.floatNo0.5
sentiment.overall.score.maxThe overall sentiment score of the articles.floatNo1.0
sentiment.overall.polarityThe overall sentiment polarity of the articles.stringNopositive

By sentiment polarity

Parameters

ParameterDescriptionTypeRequired
positiveRetrieve articles with positive sentiment.stringNo
negativeRetrieve articles with negative sentiment.stringNo
neutralRetrieve articles with neutral sentiment.stringNo

Workflow examples

Request for Positive Sentiment News:

This request retrieves news articles that have been classified with a positive sentiment.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"
Request for Positive Sentiment News from a Specific Country:

This request fetches news articles with positive sentiment specifically from Japan

shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&source.country.code=jp&api_key=YOUR_API_KEY"
Request for Positive Sentiment News in the Last 24 Hours:

This request retrieves news articles with positive sentiment published in the last 24 hours.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&published_at.start=NOW-1D&published_at.end=NOW&api_key=YOUR
Request for Articles with Positive Sentiment and a Specific Title:

This request retrieves news articles with positive sentiment that have "technology" in their titles.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&title=technology

Title

Get articles with a specific title.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
titleThe title of articlesstringNoBitcoin
ignore.titleThe title of articles to ignore.stringNoEthereum
title_starts_withThe title of articles that start with a specific stringstringNoBitcoin
title_ends_withThe title of articles that end with a specific string.stringNoBitcoin
title_patternThe title of articles that match a specific pattern. Example: ^[A-Za-z]+$stringNoBitcoin

Workflow examples

Request for Positive Sentiment News:

This request retrieves news articles with "technology" in their titles.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?title=technology&api_key=YOUR_API_KEY"
Request for Articles with Multiple Title Keywords:

This request retrieves news articles with either "AI" or "innovation" in their titles.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?title=AI,innovation&api_key=YOUR_API_KEY"
Request for Articles with Titles Excluding Certain Words:

This request retrieves news articles that do not have "celebrity" in their titles.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?ignore.title=celebrity&api_key=YOUR_API_KEY"

Category

Get articles with a specific category.

List of supported categories

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
category.idThe category ID of the articles.stringNo314
ignore.category.idThe category ID of the articles to ignore.stringNo315
category.taxonomyThe category taxonomy of the articles.stringNoiptc
ignore.category.taxonomyThe category taxonomy of the articles to ignore.stringNoiab
List of supported categories taxonomy
TaxonomyDescription
iptcIPTC
iabIAB
apitubeAPITube

Workflow examples

Request to get news articles from a specific category (e.g., "Business"):

This request retrieves news articles that fall under the "business" category.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.name=business&api_key=YOUR_API_KEY"
Request for Articles in Multiple Categories:

This request retrieves news articles that are in either the "technology" or "science" category.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.name=technology,science&api_key=YOUR_API_KEY"
Request for Articles in a Category and Filtered by Language:

This request retrieves news articles in the "politics" category that are in French.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.name=politics&language=fr&api_key=YOUR_API_KEY"

Topic

Get articles with a specific topic.

List of supported topics

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
topic.idThe topic ID of the articles.stringNo1
ignore.topic.idThe topic ID of the articles to ignore.stringNo2
topic.taxonomyThe topic taxonomy of the articles.stringNoapitube
ignore.topic.taxonomyThe topic taxonomy of the articles to ignore.stringNoapitube

Workflow examples

Request to get news articles from a specific topic (e.g., "crypto_news"):

This request retrieves news articles that fall under the "crypto news" topic.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?topic.id=crypto_news&api_key=YOUR_API_KEY"

Entities

Get articles with a specific entity.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
entity.nameThe entity name of the articles.stringNoBitcoin
ignore.entity.nameThe entity name of the articles to ignore.stringNoEthereum
entity.typeThe entity type of the articles.stringNocryptocurrency
ignore.entity.typeThe entity type of the articles to ignore.stringNocryptocurrency

Workflow examples

Request for Articles Mentioning Multiple People:

This request retrieves news articles that mention either "Barack Obama" or "Joe Biden."

shell
curl -X GET "https://api.apitube.io/v1/news/everything?entities=person:Barack Obama,person:Joe Biden&api_key=YOUR_API_KEY"
Request for Articles Mentioning a Specific Person:

This request retrieves news articles mentioning "Tim Cook" in relation to "Apple" as its CEO.

shell
curl -X GET "https://api.apitube.io/v1/news/everything?entities=person:Tim Cook,organization:Apple&api_key=YOUR_API_KEY"

Industries

Get articles with a specific industry.

List of supported industries

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
industry.idThe industry ID of the articles.stringNo246771
ignore.industry.idThe industry ID of the articles to ignore.stringNo246772

Persons

Get articles with a specific person.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
person.nameThe person name of the articles.stringNoSatoshi
ignore.person.nameThe person name of the articles to ignore.stringNoVitalik

Workflow examples

Request to get news articles about a specific person (e.g., "Satoshi"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?person.name=Satoshi&api_key=YOUR_API_KEY"
Request to get news articles about multiple people (e.g., "Satoshi" and "Vitalik"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?person.name=Satoshi,Vitalik&api_key=YOUR_API_KEY"

Locations

Get articles from a specific location.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
location.nameThe location name of the articles.stringNoTokyo
ignore.location.nameThe location name of the articles to ignore.stringNoNew York

Workflow examples

Request to get news articles from a specific location (e.g., "Tokyo"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Tokyo&api_key=YOUR_API_KEY"
Request to get news articles from multiple locations (e.g., "Tokyo" and "New York"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Tokyo,New York&api_key=YOUR_API_KEY"
Request to get news articles from a specific location and in a specific language (e.g., "Tokyo" and "Japanese") and ignore articles from "New York":
shell
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Tokyo&language=ja&ignore.location.name=New York&api_key=YOUR_API_KEY"

Authors

Get articles with a specific author.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequired
author.idThe author ID of the articles.stringNo
ignore.author.idThe author ID of the articles to ignore.stringNo
author.nameThe author name of the articles.stringNo
ignore.author.nameThe author name of the articles to ignore.stringNo

Workflow examples

Request to get news articles by a specific author (e.g., "John Doe"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?author.name=John Doe&api_key=YOUR_API_KEY"
Request to get news articles by multiple authors (e.g., "John Doe" and "Jane Doe"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?author.name=John Doe,Jane Doe&api_key=YOUR_API_KEY"
Request to get news articles by a specific author and in a specific language (e.g., "John Doe" and "English"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?author.name=John Doe&language=en&api_key=YOUR_API_KEY"

Media

Get articles with a specific media type and size.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
media.images.countThe number of images in the articles.integerNo2
media.videos.countThe number of videos in the articles.integerNo1
media.images.width.minThe minimum width of the images.integerNo200
media.images.width.maxThe maximum width of the images.integerNo800
media.images.height.minThe minimum height of the images.integerNo200
media.images.height.maxThe maximum height of the images.integerNo800

Workflow examples

Request to get news articles with a specific number of images and videos:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&api_key=YOUR_API_KEY"
Request to get news articles with images of a specific size:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?media.images.width.min=200&media.images.width.max=800&media.images.height.min=200&media.images.height.max=800&api_key=YOUR_API_KEY"

Source

Get articles with a specific source or sources.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
source.idThe source ID of the articles.intNo314
ignore.source.idThe source ID of the articles to ignore.intNo315
source.domainThe source domain of the articles.stringNocnn.com
ignore.source.domainIgnore the source domain of the articles.stringNotechcrunch.com
source.typeThe source type of the articles.stringNonews
ignore.source.typeIgnore the source type of the articles.stringNoblog
source.rank.opr.minThe minimum Open Page Rank source rank.stringNo0.5
source.rank.opr.maxThe maximum Open Page Rank source rank.stringNo0.9

Workflow examples

Request to get news articles from a specific source (e.g., "cnn.com"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.domain=cnn.com&api_key=YOUR_API_KEY"
Request to get news articles from multiple sources (e.g., "cnn.com" and "bbc.com"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.domain=cnn.com,bbc.com&api_key=YOUR_API_KEY"
Request to get news articles from a specific source and in a specific language (e.g., "cnn.com" and "English"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.domain=cnn.com&language=en&api_key=YOUR_API_KEY"
Request to get news articles from a specific source type (e.g., "news"):
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.type=news&api_key=YOUR_API_KEY"
Request to get news articles with rank between 0.5 and 0.9:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&source.rank.opr.max=0.9&api_key=YOUR_API_KEY"

Get single article

Get a single article by its ID.

Endpoints

/v1/news/article

Parameters

ParameterDescriptionTypeRequiredExample
idThe ID of the article you want to retrievestringYes314

Workflow examples

Request to get a single article by its ID:
shell
curl -X GET "https://api.apitube.io/v1/news/article?id=314&api_key=YOUR_API_KEY"

Other filters

Other powerful filters are available to help you find the articles you need.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
is_duplicateFilter articles that are duplicates.stringNotrue

Sorting

With the News API, you can sort the articles by the following parameters:

  • sort_by
  • sort_order

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters for sorting articles (sort_by)

ParameterDescriptionTypeRequired
published_atSort by the published date.stringNo
sentiment.overall.scoreSort by the overall sentiment magnitude.stringNo
source.rank.oprSort by the Open Page Rank source rank.stringNo
media.images.countSort by the number of images.stringNo
media.videos.countSort by the number of videos.stringNo

Parameters for sorting order (sort_order)

ParameterDescriptionTypeRequired
ascSort in ascending order.stringNo
descSort in descending order.stringNo

Workflow examples

Request to get news articles sorted by the published date in ascending order:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sort_by=published_at&sort_order=asc&api_key=YOUR_API_KEY"
Request to get news articles sorted by the overall sentiment magnitude in descending order:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sort_by=sentiment.overall.score&sort_order=desc&api_key=YOUR_API_KEY"

Pagination

With the News API, you can paginate the articles you want to retrieve.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Pagination with limit and offset

You can use the per_page and page parameters to specify the number of articles you want to retrieve and the starting point of the articles.

Parameters

ParameterDescriptionTypeRequired
per_pageThe number of articles you want to retrieve.integerNo
pageThe starting point of the articles.integerNo

Pagination with cursor

You can use the next_page_cursor parameter to specify the starting point of the articles.

Parameters

ParameterDescriptionTypeRequired
next_page_cursorThe starting point of the articles.stringNo

Workflow examples

Request to get news articles with pagination:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?per_page=10&page=1&api_key=YOUR_API_KEY"
Request to get news articles with cursor pagination:
shell
curl -X GET "https://api.apitube.io/v1/news/everything?next_page_cursor=eyJ2IjoiMCIsImEiOiJ0aGlyZCJ9&api_key=YOUR_API_KEY"

Export articles

With the News API, you can export the articles in formats such as JSON, XML, XLSX, CSV and TSV.

Endpoints

/v1/news/everything

/v1/news/top-headlines

/v1/news/story

/v1/news/article

/v1/news/category

/v1/news/topic

/v1/news/industry

/v1/news/entity

Parameters

ParameterDescriptionTypeRequiredExample
exportThe format in which you want to export.stringNojson

Formats

FormatDescription
jsonJSON
xmlXML
xlsxXLSX
csvCSV
tsvTSV