Documentation
Sign up for free!
Get instant access to the API with your free API token. No billing details required!
Getting Started
Introduction
Our API was developed to provide global news from thousands of sources with exceptional response times. On average we add over 1 million articles weekly, so you will never be short of content. Even better, it is completely free!
To get started simply sign up and use your API token in any of the available API endpoints documented below for instant access.
If you have any questions or concerns, feel free to contact us.
Authentication
As mentioned above, when you sign up for free you will find your API token on your dashboard. Simply add this to any of our API endpoints as a GET parameter to gain access. Examples of how this is done can be found below.
API Endpoints
Headlines Available on: Standard plan and above
Endpoint
GET https://api.thenewsapi.com/v1/news/headlines HTTP/1.1
Use this endpoint to find get the latest headlines by category along with similar articles, allowing you to create the perfect news aggregation page similar to Google News .
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
All dates are in UTC (GMT).
HTTP GET Parameters
| name | required | description |
|---|---|---|
api_token |
true | Your API token which can be found on your account dashboard. |
locale |
false | Comma separated list of country codes to include in the result set. Default is all countries.
Click here for a list of supported countries.
Example: us,ca (US + Canada).
|
domains |
false | Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page. |
exclude_domains |
false | Comma separated list of domains to exclude |
source_ids |
false | Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page. |
exclude_source_ids |
false | Comma separated list of source_ids to exclude. |
language |
false | Comma separated list of languages to include. Default is all.
Click here for a list of supported languages. Examples: en,es (English + Spanish)
|
published_on |
false | Find headlines for articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-06-12
|
headlines_per_category |
false | Specify the number of articles you want to return per category. The maximum is 10 and the default is 6. |
include_similar |
false | Specify if you wish to include similar articles with each base article. Default is true. |
Response Objects
| name | description |
|---|---|
data > uuid |
The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint. |
data > title |
The article title. |
data > description |
The article meta description. |
data > keywords |
The article meta keywords. |
data > snippet |
The first 60 characters of the article body. |
data > url |
The URL to the article. |
data > image_url |
The URL to the article image. |
data > language |
The language of the source. |
data > published_at |
The datetime the article was published. |
data > source |
The domain of the source. |
data > categories |
Array of strings which the source is categorized as. |
data > locale |
Locale of the source. |
data > similar |
An array of similar articles to the base article. |
If no results are found, the data object will be empty.
Example Request
GET https://api.thenewsapi.com/v1/news/headlines?locale=us&language=en&api_token=YOUR_API_TOKEN
Example Response
{
"data": {
"general": [
{
"uuid": "f5794ada-fb31-4a8c-aea2-8354b31b052a",
"title": "Portland man sentenced to 30 months in prison for throwing rock at ICE officer during protest",
"description": "Robert Jacob Hoopes, who admitted to assaulting a federal officer during protests outside an ICE facility in Portland, Oregon, last year, was sentenced to 30 months in federal prison on Thursday.",
"keywords": "US News, assaults, crime, ice, immigration, oregon, portland, protesters, riots",
"snippet": "See more of our coverage in your search results.\n\nA man who admitted to assaulting a federal officer during protests outside a US Immigration and Customs Enforc...",
"url": "https://nypost.com/2026/06/12/us-news/portland-man-robert-jacob-hoopes-sentenced-to-30-months-in-prison-for-throwing-rock-at-ice-officer/",
"image_url": "https://nypost.com/wp-content/uploads/sites/2/2026/06/130670626.jpg?quality=75&strip=all&w=1200",
"language": "en",
"published_at": "2026-06-12T06:55:25.000000Z",
"source": "nypost.com",
"categories": [
"general"
],
"locale": "us",
"similar": [
{
"uuid": "8878573e-f468-4d07-969b-85f2cbc5c507",
"title": "Anti-ICE protester sentenced to 30 months in prison for assaulting a federal officer",
"description": "A man accused of assaulting a federal officer during protests at the U.S. Immigration and Customs Enforcement building in Portland, Oregon, has been sentenced to 30 months in prison",
"keywords": "Immigration, General news, Immigrant detention, Criminal punishment, Assault, Protests and demonstrations, U.S. news",
"snippet": "A man accused of assaulting a federal officer during protests at the U.S. Immigration and Customs Enforcement building in Portland, Oregon, has been sentenced t...",
"url": "https://abcnews.com/US/wireStory/anti-ice-protester-portland-sentenced-30-months-prison-133802888",
"image_url": "https://i.abcnewsfe.com/a/d5552bc1-2a52-426e-995b-e62d61260a5c/wirestory_e59aeddab33cc03d5ce6fb3f53869c90_16x9.jpg?w=1600",
"language": "en",
"published_at": "2026-06-12T00:48:45.000000Z",
"source": "abcnews.go.com",
"categories": [
"general"
],
"locale": "us"
},
{
"uuid": "4c64fd99-f86d-4efd-aeaa-383080443fbe",
"title": "Portland man sentenced to 30 months in prison for throwing rock at ICE officer during protest",
"description": "Portland man Robert Jacob Hoopes was sentenced to 30 months in federal prison for throwing a rock at an ICE officer during a June 2025 protest in Oregon.",
"keywords": "police and law enforcement, oregon, immigration, immigrant rights, portland",
"snippet": "NEW You can now listen to Fox News articles!\n\nA man who admitted to assaulting a federal officer during protests outside a U.S. Immigration and Customs Enforcem...",
"url": "https://www.foxnews.com/us/portland-man-sentenced-30-months-prison-throwing-rock-ice-officer-protest",
"image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2026/02/federal-agent-ice-dhs.jpg",
"language": "en",
"published_at": "2026-06-12T03:57:12.000000Z",
"source": "foxnews.com",
"categories": [
"general",
"politics"
],
"locale": "us"
}
]
},
{
"uuid": "474316c6-55db-499b-a08f-ec8cf3493ab2",
"title": "México líder: así quedó el Grupo A tras el primer día del Mundial | Todo el Mundial",
"description": "El equipo de Javier Aguirre debutó con triunfo ante Sudáfrica y se fue a la cima del Grupo A, mientras Corea del Sur le sigue tras su remontada ante Chequia. La afición mexicana enloqueció y festejó por todo el mundo.",
"keywords": "",
"snippet": "México líder: así quedó el Grupo A tras el primer día del Mundial | Todo el Mundial\n\nEl equipo de Javier Aguirre debutó con triunfo ante Sudáfrica y se f...",
"url": "https://www.telemundo.com/deportes/copa-mundial-de-la-fifa-2026/video/mexico-lider-asi-quedo-el-grupo-a-tras-el-primer-dia-del-mundial-todo-el-mundial-tmvo13193349",
"image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/telemundocms/MPX/image/NBCU_Telemundo/500/435/46495057588-1080pnbcstations.jpg",
"language": "en",
"published_at": "2026-06-12T06:29:58.000000Z",
"source": "nbcnews.com",
"categories": [
"general",
"politics"
],
"locale": "us",
"similar": [
{
"uuid": "f0b30871-fb8d-41f9-9597-14b0e2f30e23",
"title": "El Tri aprobó su primer examen: análisis del triunfo de México ante Sudáfrica",
"description": "Los analistas destacan la sólida actuación de México en el Estadio Azteca, el gol de Raúl Jiménez, la propuesta de Javier Aguirre y la expulsión de César Montes en el triunfo 2-0 sobre Sudáfrica.",
"keywords": "",
"snippet": "El Tri aprobó su primer examen: análisis del triunfo de México ante Sudáfrica\n\nLos analistas destacan la sólida actuación de México en el Estadio Azteca,...",
"url": "https://www.telemundo.com/deportes/copa-mundial-de-la-fifa-2026/video/el-tri-aprobo-su-primer-examen-analisis-del-triunfo-de-mexico-ante-sudafrica-tmvo13193154",
"image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/telemundocms/MPX/image/NBCU_Telemundo/463/323/46489658505-1080pnbcstations.jpg",
"language": "en",
"published_at": "2026-06-12T00:08:55.000000Z",
"source": "nbcnews.com",
"categories": [
"general",
"politics"
],
"locale": "us"
},
{
"uuid": "01a44f10-5692-493a-a8ad-9153588cc14c",
"title": "Corea del Sur firma emocionante remontada ante Chequia en su debut en el Mundial 2026",
"description": "El conjunto asiático protagonizó una vibrante voltereta ante República Checa en el Estadio Guadalajara con goles de Hwang In-Beom y Oh Hwang y Oh, con lo que se va a la cima del Grupo A junto a México con tres puntos en inicio del Mundial 2026.",
"keywords": "",
"snippet": "El conjunto asiático protagonizó una vibrante voltereta ante República Checa en el Estadio Guadalajara con goles de Hwang In-Beom y Oh Hwang y Oh, con lo que...",
"url": "https://www.telemundo.com/deportes/copa-mundial-de-la-fifa-2026/video/corea-del-sur-firma-emocionante-remontada-ante-chequia-en-su-debut-en-el-mundial-2026-tmvo13193312",
"image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/telemundocms/MPX/image/NBCU_Telemundo/483/843/46493663777-1080pnbcstations.jpg",
"language": "en",
"published_at": "2026-06-12T04:48:56.000000Z",
"source": "nbcnews.com",
"categories": [
"general",
"politics"
],
"locale": "us"
}
]
}
],
"business": ...,
"sports": ...,
"tech": ...,
"science": ...,
"health": ...
}
}
Top Stories Available on: All plans
Endpoint
GET https://api.thenewsapi.com/v1/news/top HTTP/1.1
Use this endpoint to find live and historical top stories around the world or filter to get only top stories for specific countries. Filtering by language, category, source and publish date is also possible, as well as advanced searching on title and the main text of the article.
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
All dates are in UTC (GMT).
HTTP GET Parameters
| name | required | description |
|---|---|---|
api_token |
true | Your API token which can be found on your account dashboard. |
search |
false | Use the search as a basic search tool by entering regular search terms or it has more advanced usage to build search queries:+ signifies AND operation| signifies OR operation- negates a single token" wraps a number of tokens to signify a phrase for searching* at the end of a term signifies a prefix query( and ) signify precedence
To use one of these characters literally, escape it with a preceding backslash ( \).
Example 1: forex + (usd | gbp) -cad (searches for forex articles which include usd or gbp but excludes cad)Example 2: "Apple Inc" (searches for articles with exact matches for "Apple Inc")
For more advanced query examples, see our API Examples section. When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter. |
search_fields |
false | Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywordsDefault: title,main_text
|
locale |
false | Comma separated list of country codes to include in the result set. Default is all countries.
Click here for a list of supported countries.
Example: us,ca (US + Canada).
|
categories |
false | Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel Example: business,tech
|
exclude_categories |
false | Comma separated list of categories to exclude. |
domains |
false | Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page. |
exclude_domains |
false | Comma separated list of domains to exclude |
source_ids |
false | Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page. |
exclude_source_ids |
false | Comma separated list of source_ids to exclude. |
language |
false | Comma separated list of languages to include. Default is all.
Click here for a list of supported languages. Examples: en,es (English + Spanish)
|
published_before |
false | Find all articles published before the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_after |
false | Find all articles published after the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_on |
false | Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-06-12
|
sort |
false | Sort by published_on or relevance_score (only available when used in conjunction with search).
Default is published_at unless search is used and sorting by published_at is not included,
in which case relevance_score is used. |
limit |
false | Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan. |
page |
false | Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2
|
Response Objects
| name | description |
|---|---|
meta > found |
The number of articles found for the request. |
meta > returned |
The number of articles returned on the page.
This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page. |
meta > limit |
The limit based on the limit parameter. |
meta > page |
The page number based on the page parameter. |
data > uuid |
The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint. |
data > title |
The article title. |
data > description |
The article meta description. |
data > keywords |
The article meta keywords. |
data > snippet |
The first 60 characters of the article body. |
data > url |
The URL to the article. |
data > image_url |
The URL to the article image. |
data > language |
The language of the source. |
data > published_at |
The datetime the article was published. |
data > source |
The domain of the source. |
data > categories |
Array of strings which the source is categorized as. |
data > relevance_score |
Relevance score based on the search parameter. If the search parameter is not used, this will be null. |
data > locale |
Locale of the source. |
If no results are found, the data object will be empty.
Example Request
GET https://api.thenewsapi.com/v1/news/top?api_token=YOUR_API_TOKEN&locale=us&limit=3
Example Response
{
"meta": {
"found": 1643341,
"returned": 10,
"limit": 10,
"page": 1
},
"data": [
{
"uuid": "6e14548a-3e00-4c45-840f-c4bf975a797b",
"title": "The next AI safety fight may actually be about DNA",
"description": "AI could make bioweapons easier to build. A rare coalition wants to stop that now.",
"keywords": "",
"snippet": "is a Future Perfect fellow, Vox’s section on making the world a better place. She reports on emerging technology, biosecurity, and human and animal health.\n\nA...",
"url": "https://www.vox.com/future-perfect/491660/artificial-intelligence-openai-anthropic-dna-bioweapons",
"image_url": "https://platform.vox.com/wp-content/uploads/sites/2/2026/06/gettyimages-2264238243.jpg?quality=90&strip=all&crop=0%2C10.744681348811%2C100%2C78.510637302378&w=1200",
"language": "en",
"published_at": "2026-06-12T11:04:03.000000Z",
"source": "vox.com",
"categories": [
"general",
"politics",
"entertainment"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "68261f14-cca0-4fb7-bb85-ad0c1ea907cd",
"title": "Mon Laferte on Her New Era: 'My Voice Has Been My Shield'",
"description": "Mon Laferte chats exclusively with Us Weekly about her latest album, 'Femme Fatale Vol. 2,' taking career risks and her voice being her greatest strength",
"keywords": "",
"snippet": "Mon Laferte isn’t interested in playing it safe — and her latest chapter proves it.\n\nThe Chilean-Mexican singer-songwriter, who has earned over 20 Latin Gra...",
"url": "https://www.usmagazine.com/celebrity-news/news/mon-laferte-on-her-new-era-my-voice-has-been-my-shield/",
"image_url": "https://www.usmagazine.com/wp-content/uploads/2026/06/Mon-Laferte.jpg?crop=0px%2C35px%2C2000px%2C1051px&resize=1200%2C630&quality=86&strip=all",
"language": "en",
"published_at": "2026-06-12T11:00:45.000000Z",
"source": "usmagazine.com",
"categories": [
"entertainment",
"general"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "6be22ccb-dd47-4011-8a94-1e95594f41db",
"title": "Helen Mirren Says Artists Are Not Political Animals",
"description": "Helen Mirren Says Artists Are Not Political Animals:",
"keywords": "",
"snippet": "Oscar-winning actress Helen Mirren, who has hit the headlines while at the Taormina Film Festival in Italy for comments on Israel’s treatment of Palestinians,...",
"url": "https://deadline.com/2026/06/helen-mirren-artists-not-political-animals-taormina-1236954609/",
"image_url": "https://deadline.com/wp-content/uploads/2026/06/MixCollage-12-Jun-2026-12-44-PM-6611.jpg?w=1024",
"language": "en",
"published_at": "2026-06-12T10:50:08.000000Z",
"source": "deadline.com",
"categories": [
"entertainment"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "33126cda-b20f-441b-9bfd-7993e5affe77",
"title": "Trump’s strange flirtation with AI socialism, explained",
"description": "Donald Trump is in talks with OpenAI about the government acquiring a stake in the AI company, thereby allowing all Americans to share in its profits.",
"keywords": "",
"snippet": "is a senior correspondent at Vox. He covers a wide range of political and policy issues with a special focus on questions that internally divide the American le...",
"url": "https://www.vox.com/politics/491608/trump-openai-sam-altman-wealth-fund",
"image_url": "https://platform.vox.com/wp-content/uploads/sites/2/2025/06/gettyimages-2194584986.jpg?quality=90&strip=all&crop=0%2C0%2C100%2C78.52610588819&w=1200",
"language": "en",
"published_at": "2026-06-12T10:48:48.000000Z",
"source": "vox.com",
"categories": [
"general",
"politics",
"entertainment"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "4cda444f-ed9b-4747-88db-96b3476cc14e",
"title": "TPUSA’s new message to girls: Hate yourself",
"description": "Speakers at the women's leadership summit continued Charlie Kirk's misogynist mission",
"keywords": "",
"snippet": "Turning Point USA was co-founded by Charlie Kirk and its fundraising apparatus since his death has centered around fading MAGA fantasies that he will be a movem...",
"url": "https://www.salon.com/2026/06/12/tpusas-new-message-to-girls-hate-yourself/",
"image_url": "https://www.salon.com/app/uploads/2026/06/alex-clark-GettyImages-2220158875.jpg",
"language": "en",
"published_at": "2026-06-12T10:45:15.000000Z",
"source": "salon.com",
"categories": [
"general"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "e00974f3-f403-43ce-8dad-c5c5f1de0da5",
"title": "Empty seats on World Cup’s opening day renew ticket price concerns",
"description": "The World Cup opened with jubilation in Mexico City as a packed stadium roared the hosts to victory.",
"keywords": "",
"snippet": "The World Cup opened with jubilation in Mexico City as a packed stadium roared the hosts to victory. But the second game of the tournament saw empty seats visib...",
"url": "https://www.nbcnews.com/sports/soccer/empty-seats-world-cups-opening-day-renew-ticket-price-concerns-rcna349748",
"image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2026-06/260612-fifa-rs-3b68ad.jpg",
"language": "en",
"published_at": "2026-06-12T10:31:48.000000Z",
"source": "nbcnews.com",
"categories": [
"general",
"politics"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "5d0b8c80-bac3-4ef9-933b-371166cbeee7",
"title": "AI data centers are taking over. These Americans are fighting back",
"description": "Energy and water intensive AI projects are draining communities. The revolt is just getting started",
"keywords": "",
"snippet": "In a rare moment of bipartisanship, there’s a force uniting Americans across the country: opposition to data centers.\n\nIn nearly every state, hyperscale data ...",
"url": "https://www.salon.com/2026/06/12/ai-data-centers-are-taking-over-america-fighting-back-isnt-easy/",
"image_url": "https://www.salon.com/app/uploads/2026/06/data-center-fight-utah.jpg",
"language": "en",
"published_at": "2026-06-12T10:30:48.000000Z",
"source": "salon.com",
"categories": [
"general"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "1dd0098e-4020-4d7d-8c5e-bfb184401884",
"title": "Adobe Pauses Price Hikes For 'Short-Term' AI Push—But At What Cost To ARR Growth? - Adobe (NASDAQ:ADBE)",
"description": "Adobe pauses price hikes for a",
"keywords": "",
"snippet": "Freemium Funnel Over Price Hikes\n\nDuring Thursday's second-quarter earnings call, management revealed that while the second-quarter revenue grew 11% year-over-y...",
"url": "https://www.benzinga.com/markets/earnings/26/06/53161546/adobe-pauses-price-hikes-for-short-term-ai-push-but-at-what-cost-to-arr-growth",
"image_url": "https://cdn.benzinga.com/cdn-cgi/image/width=1200,height=800,fit=crop/files/images/story/2026/06/12/Adobe.jpeg",
"language": "en",
"published_at": "2026-06-12T10:29:35.000000Z",
"source": "benzinga.com",
"categories": [
"business"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "abfdd01f-5cff-4eb6-888f-23a304deb665",
"title": "Family alleges OB-GYN used his own sperm for insemination instead of agreed-upon donor’s",
"description": "Joseph Laedtke, 43, learned through an ancestry test that he had nine half-siblings, who he says connect back to his mother’s fertility doctor from the 1980s.",
"keywords": "",
"snippet": "When Joseph Laedtke got the results of his ancestry DNA test in December 2024, he was shocked to learn he had nine half-siblings. And that they all seemed to tr...",
"url": "https://www.nbcnews.com/news/us-news/family-alleges-ob-gyn-used-sperm-insemination-instead-agreed-donors-rcna349498",
"image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2026-06/260611-Laedtke-family-ew-714p-cdcd27.jpg",
"language": "en",
"published_at": "2026-06-12T10:29:06.000000Z",
"source": "nbcnews.com",
"categories": [
"general",
"politics"
],
"relevance_score": null,
"locale": "us"
},
{
"uuid": "80a8d53a-e566-4a19-a37e-924f8ae64104",
"title": "China arrests U.S. researcher on suspicion of \"espionage and endangering national security\"",
"description": "China says U.S. national U Min Zin, founder of a think tank focused on Myanmar, was detained on suspicion of",
"keywords": "Spying, Myanmar, China",
"snippet": "China has arrested an American citizen for alleged espionage, the country's government confirmed Friday, identifying the man as a political analyst for a policy...",
"url": "https://www.cbsnews.com/news/china-arrest-us-researcher-espionage-spying-national-security-myanmar/",
"image_url": "https://assets1.cbsnewsstatic.com/hub/i/r/2026/06/12/9a67ca85-661d-44d8-868b-bb249cc15938/thumbnail/1200x630/5db198612651c4544872a76162b715a6/gettyimages-2277401224.jpg",
"language": "en",
"published_at": "2026-06-12T10:20:33.000000Z",
"source": "cbsnews.com",
"categories": [
"general",
"politics"
],
"relevance_score": null,
"locale": "us"
}
]
}
All News Available on: All plans
Endpoint
GET https://api.thenewsapi.com/v1/news/all HTTP/1.1
Use this endpoint to find all live and historical articles we collect. Filtering by language, category, source and publish date is also possible, as well as advanced searching on title and the main text of the article.
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
All dates are in UTC (GMT).
HTTP GET Parameters
| name | required | description |
|---|---|---|
api_token |
true | Your API token which can be found on your account dashboard. |
search |
false | Use the search as a basic search tool by entering regular search terms or it has more advanced usage to build search queries:+ signifies AND operation| signifies OR operation- negates a single token" wraps a number of tokens to signify a phrase for searching* at the end of a term signifies a prefix query( and ) signify precedence
To use one of these characters literally, escape it with a preceding backslash ( \).
Example 1: forex + (usd | gbp) -cad (searches for forex articles which include usd or gbp but excludes cad)Example 2: "Apple Inc" (searches for articles with exact matches for "Apple Inc")
For more advanced query examples, see our API Examples section. When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter. |
search_fields |
false | Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywordsDefault: title,main_text
|
categories |
false | Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel Example: business,tech
|
exclude_categories |
false | Comma separated list of categories to exclude. |
domains |
false | Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page. |
exclude_domains |
false | Comma separated list of domains to exclude |
source_ids |
false | Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page. |
exclude_source_ids |
false | Comma separated list of source_ids to exclude. |
language |
false | Comma separated list of languages to include. Default is all.
Click here for a list of supported languages. Examples: en,es (English + Spanish)
|
published_before |
false | Find all articles published before the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_after |
false | Find all articles published after the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_on |
false | Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-06-12
|
sort |
false | Sort by published_on or relevance_score (only available when used in conjunction with search).
Default is published_at unless search is used and sorting by published_at is not included,
in which case relevance_score is used. |
limit |
false | Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan. |
page |
false | Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2
|
Response Objects
| name | description |
|---|---|
meta > found |
The number of articles found for the request. |
meta > returned |
The number of articles returned on the page.
This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page. |
meta > limit |
The limit based on the limit parameter. |
meta > page |
The page number based on the page parameter. |
data > uuid |
The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint. |
data > title |
The article title. |
data > description |
The article meta description. |
data > keywords |
The article meta keywords. |
data > snippet |
The first 60 characters of the article body. |
data > url |
The URL to the article. |
data > image_url |
The URL to the article image. |
data > language |
The language of the source. |
data > published_at |
The datetime the article was published. |
data > source |
The domain of the source. |
data > categories |
Array of strings which the source is categorized as. |
data > relevance_score |
Relevance score based on the search parameter. If the search parameter is not used, this will be null. |
If no results are found, the data object will be empty.
Example Request
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&language=en&limit=3
Example Response
{
"meta": {
"found": 54337534,
"returned": 10,
"limit": 10,
"page": 1
},
"data": [
{
"uuid": "bdfd151d-4f7d-461f-9bed-c0b2b3de0c91",
"title": "'축구하면 치킨이지' 쿠팡이츠, 배달비 무료에 할인 공세 - 신아일보",
"description": "배달 플랫폼 쿠팡이츠가 6월 한 달여간 BBQ, 네네, 멕시카나 등 인기 치킨 브랜드들과 할인전을 전개한다.12일 쿠팡이츠에 ...",
"keywords": "",
"snippet": "쿠팡이츠의 치킨 할인행사 이미지. [제공=쿠팡이츠]\n\n배달 플랫폼 쿠팡이츠가 6월 한 달여간 BBQ, 네네, 멕시카나 등 인기 ?...",
"url": "https://www.shinailbo.co.kr/news/articleView.html?idxno=5029921",
"image_url": "https://cdn.shinailbo.co.kr/news/photo/202606/5029921_2028532_1421.png",
"language": "ko",
"published_at": "2026-06-12T11:14:52.000000Z",
"source": "shinailbo.co.kr",
"categories": [],
"relevance_score": null
},
{
"uuid": "aa9b2b96-1ac5-4143-b979-e9d6d7bcb97c",
"title": "사인 글로벌, 정부 주도 디지털 화폐 인프라 비전 제시",
"description": "디지털 인프라 기업 사인 글로벌(Sign Global)의 신 옌(Xin Yan) 대표가 포브스 ‘온더마진(On the Margin) 팟캐스트 인터뷰를 통해...",
"keywords": "",
"snippet": "디지털 인프라 기업 사인 글로벌(Sign Global)의 신 옌(Xin Yan) 대표가 포브스 ‘온더마진(On the Margin) 팟캐스트 인터뷰를 통해...",
"url": "https://www.datanet.co.kr/news/articleView.html?idxno=212313",
"image_url": "https://cdn.datanet.co.kr/news/thumbnail/202606/212313_136469_1413_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:14:47.000000Z",
"source": "datanet.co.kr",
"categories": [
"tech"
],
"relevance_score": null
},
{
"uuid": "b792ec3c-d146-4eb5-87f7-dcb16527a220",
"title": "[MOVIE 비하인드] ‘토이 스토리 5’, 버즈 군단부터 말하는 불스아이까지",
"description": "시사위크=이영실 기자 수많은 버즈가 등장하고, 한 번도 말을 하지 않았던 불스아이가 처음 목소리를 낸다. 영화 ‘토이 ...",
"keywords": "",
"snippet": "‘토이 스토리 5’에 새롭게 등장하는 버즈 군단. / 월트디즈니 컴퍼니 코리아\n\n시사위크=이영실 기자 수많은 버즈가 등?...",
"url": "https://www.sisaweek.com/news/articleView.html?idxno=236073",
"image_url": "https://cdn.sisaweek.com/news/thumbnail/202606/236073_252584_837_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:14:22.000000Z",
"source": "sisaweek.com",
"categories": [],
"relevance_score": null
},
{
"uuid": "c358cf80-36cf-4b14-9bbf-f329d3eae4af",
"title": "“에너지 정책, 국가 생존의 문제”… 에교협, 프레스센터서 제17차 토론회 개최 - 에너지코리아",
"description": "에너지 업계와 학계의 전문가들이 모여 대한민국의 지속 가능한 발전을 위한 에너지 정책 방향을 점검하고 현실적인 대?...",
"keywords": "",
"snippet": "에너지 업계와 학계의 전문가들이 모여 대한민국의 지속 가능한 발전을 위한 에너지 정책 방향을 점검하고 현실적인 대?...",
"url": "https://www.energykorea.co.kr/news/articleView.html?idxno=65377",
"image_url": "https://www.energykorea.co.kr/image/logo/snslogo_20250123033654.png",
"language": "ko",
"published_at": "2026-06-12T11:14:20.000000Z",
"source": "energykorea.co.kr",
"categories": [],
"relevance_score": null
},
{
"uuid": "04f7d898-6f7c-4daf-b1b6-809e284eee8f",
"title": "LX-네이버, 사우디 디지털트윈 고도화 나선다…'K-공간정보 플랫폼' 중동 확산 본격화 - 이코노미사이언스",
"description": "| 이코노미사이언스 정연재 기자 |도시를 가상공간에 그대로 구현하는 디지털트윈 기술이 단순 시뮬레이션을 넘어 실제 ...",
"keywords": "",
"snippet": "네이버 이노베이션 야세르 알오바이단(Yasser Alobaidan) CEO(좌)와 한국국토정보공사 심병섭 공간정보본부장(우)이 양해각서 ...",
"url": "https://www.e-science.co.kr/news/articleView.html?idxno=130537",
"image_url": "https://cdn.e-science.co.kr/news/photo/202606/130537_62297_1229.jpg",
"language": "ko",
"published_at": "2026-06-12T11:14:10.000000Z",
"source": "astronomer.rocks",
"categories": [
"science"
],
"relevance_score": null
},
{
"uuid": "73b4b962-8f95-4f0c-8308-39d6ec1ba555",
"title": "기후부 일반수소 입찰 감축 괜찮나…기술 과도기 '불일치' 논란",
"description": "기후에너지환경부가 올해 일반수소발전 입찰 물량을 대폭 축소하면서 업계가 생존 위협을 받을 것이라는 지적이 나온다...",
"keywords": "",
"snippet": "청정수소 기술 장벽 높은데 징검다리 축소해 중소 협력사 위기\n\n(서울=연합인포맥스) 이재헌 기자 = 기후에너지환경부가 ...",
"url": "https://news.einfomax.co.kr/news/articleView.html?idxno=4419691",
"image_url": "https://cdn.news.einfomax.co.kr/news/thumbnail/202606/4419691_321885_154_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:14:03.000000Z",
"source": "news.einfomax.co.kr",
"categories": [
"general"
],
"relevance_score": null
},
{
"uuid": "6659faed-ea01-48ff-afa7-e33c9be2f4f1",
"title": "[기자수첩] 젠슨 황의 ‘선물’이 남긴 숙제",
"description": "시사위크=박설민 기자 지난 5일부터 9일까지 젠슨 황 엔비디아(NVIDIA) 최고경영자(CEO)의 방한에 대한민국이 들썩였다. 삼?...",
"keywords": "젠슨 황, 엔비디아, 반도체, 삼성전자, SK하이닉스",
"snippet": "시사위크=박설민 기자 지난 5일부터 9일까지 젠슨 황 엔비디아(NVIDIA) 최고경영자(CEO)의 방한에 대한민국이 들썩였다. 삼?...",
"url": "https://www.sisaweek.com/news/articleView.html?idxno=236071",
"image_url": "https://cdn.sisaweek.com/news/thumbnail/202606/236071_252582_517_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:14:02.000000Z",
"source": "sisaweek.com",
"categories": [],
"relevance_score": null
},
{
"uuid": "59fca5f2-b44b-43c4-aa6d-4e6f0d995bf0",
"title": "인도 發 자동차 공급망 재편 주목, 우리 물류기업도 기회",
"description": "중동 전쟁과 고유가 여파로 글로벌 자동차 공급망 재편이 가속화되는 가운데, 한국 자동차 부품기업들이 인도를 새로운 ...",
"keywords": "",
"snippet": "중동 전쟁과 고유가 여파로 글로벌 자동차 공급망 재편이 가속화되는 가운데, 한국 자동차 부품기업들이 인도를 새로운 ...",
"url": "https://www.klnews.co.kr/news/articleView.html?idxno=321459",
"image_url": "https://cdn.klnews.co.kr/news/thumbnail/202606/321459_64714_1256_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:13:41.000000Z",
"source": "klnews.co.kr",
"categories": [
"general"
],
"relevance_score": null
},
{
"uuid": "f861657d-c315-4e51-8cb3-bbe496a8e1ad",
"title": "[한국갤럽 여론조사] 이재명 대통령·민주당 지지율 급락",
"description": "[굿모닝충청 조하준 기자] 12일 발표된 여론조사기관 한국갤럽의 6월 2주 차 정기여론조사 결과에 따르면 이재명 대통령?...",
"keywords": "한국갤럽, 여론조사, 이재명, 더불어민주당, 국민의힘, 조국혁신당, 진보당, 개혁신당, 지방선거, 투표용지 부족 사태, 재선거",
"snippet": "12일 발표된 한국갤럽의 6월 2주 차 정기여론조사 결과. 이재명 대통령의 직무수행평가는 긍정 57%, 부정 35%를 기록했다.(?...",
"url": "https://www.goodmorningcc.com/news/articleView.html?idxno=447429",
"image_url": "https://cdn.goodmorningcc.com/news/thumbnail/202606/447429_461039_2720_v150.jpg",
"language": "ko",
"published_at": "2026-06-12T11:13:18.000000Z",
"source": "goodmorningcc.com",
"categories": [
"general"
],
"relevance_score": null
},
{
"uuid": "227fadd6-24c1-478a-86de-64f7b41b0b5a",
"title": "NH투자증권, 차기 수장에 배광수·신재욱 각자대표 내정 - 뉴스톱",
"description": "4개월간 표류하던 NH투자증권의 새로운 수장 인선의 윤곽이 드러났다. 윤병운 대표의 연임이 무산된 가운데 새 각자 대표...",
"keywords": "",
"snippet": "기사의 본문 내용은 이 글자크기로 변경됩니다.\n\n(왼쪽부터)배광수, 신재욱 NH투자증권 각자 대표이사 내정자. 사진=NH투?...",
"url": "https://www.newstopkorea.com/news/articleView.html?idxno=45490",
"image_url": "https://cdn.newstopkorea.com/news/photo/202606/45490_46311_713.jpg",
"language": "ko",
"published_at": "2026-06-12T11:13:15.000000Z",
"source": "newstof.com",
"categories": [
"general"
],
"relevance_score": null
}
]
}
Similar News Available on: All plans
Endpoint
GET https://api.thenewsapi.com/v1/news/similar/uuid HTTP/1.1
Use this endpoint to find similar stories to a specific article based on its UUID.
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
All dates are in UTC (GMT).
HTTP GET Parameters
| name | required | description |
|---|---|---|
api_token |
true | Your API token which can be found on your account dashboard. |
categories |
false | Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel Example: business,tech
|
exclude_categories |
false | Comma separated list of categories to exclude. |
domains |
false | Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page. |
exclude_domains |
false | Comma separated list of domains to exclude |
source_ids |
false | Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page. |
exclude_source_ids |
false | Comma separated list of source_ids to exclude. |
language |
false | Comma separated list of languages to include. Default is all.
Click here for a list of supported languages. Examples: en,es (English + Spanish)
|
published_before |
false | Find all articles published before the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_after |
false | Find all articles published after the specified date. Supported formats include:
Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2026-06-12T11:15:03 |
2026-06-12T11:15 |
2026-06-12T11 |
2026-06-12 |
2026-06 |
2026
|
published_on |
false | Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-06-12
|
limit |
false | Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan. |
page |
false | Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2
|
Response Objects
| name | description |
|---|---|
meta > found |
The number of articles found for the request. |
meta > returned |
The number of articles returned on the page.
This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page. |
meta > limit |
The limit based on the limit parameter. |
meta > page |
The page number based on the page parameter. |
data > uuid |
The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint. |
data > title |
The article title. |
data > description |
The article meta description. |
data > keywords |
The article meta keywords. |
data > snippet |
The first 60 characters of the article body. |
data > url |
The URL to the article. |
data > image_url |
The URL to the article image. |
data > language |
The language of the source. |
data > published_at |
The datetime the article was published. |
data > source |
The domain of the source. |
data > categories |
Array of strings which the source is categorized as. |
data > relevance_score |
Relevance score based on the article provided. |
If no results are found, the data object will be empty.
Example Request
GET https://api.thenewsapi.com/v1/news/similar/cc11e3ab-ced0-4a42-9146-e426505e2e67?api_token=YOUR_API_TOKEN&language=en&published_on=2020-12-01
Example Response
{
"meta": {
"found": 3571,
"returned": 3,
"limit": 3,
"page": 1
},
"data": [
{
"uuid": "df4ad427-a672-4c67-b6c6-6f81aa00e164",
"title": "Tesla stock jumps after announcement it will join S&P 500 in one go",
"description": "Tesla's stock price surged early Tuesday after the company b...",
"keywords": "Business, s&p 500, stocks, tesla",
"snippet": "Tesla’s stock price surged early Tuesday after the company...",
"url": "https://nypost.com/2020/12/01/tesla-stock-jumps-on-news-it-will-join-sp-500-in-one-shot/",
"image_url": "https://nypost.com/wp-content/uploads/sites/2/2020/12/tesla-52.jpg?quality=90&strip=all&w=1200",
"language": "en",
"published_at": "2020-12-01T14:35:46.000000Z",
"source": "nypost.com",
"categories": [
"business"
],
"relevance_score": 153.61266
},
{
"uuid": "c9a23881-12dd-4005-8982-7b6552a2eb50",
"title": "Tesla To Join S&P 500 With Full Market Cap On December 21",
"description": "Tesla will be added to the S&P 500 index all at once at its ...",
"keywords": "Tesla, S&P500, EV, Automotive, Stocks, Investing",
"snippet": "Tesla (NASDAQ: TSLA) will be added to the S&P 500 index all ...",
"url": "https://oilprice.com/Latest-Energy-News/World-News/Tesla-To-Join-SP-500-With-Full-Market-Cap-On-December-21.html",
"image_url": "https://d32r1sh890xpii.cloudfront.net/news/718x300/2020-12-01_xwjdajwctl.jpg",
"language": "en",
"published_at": "2020-12-01T16:30:00.000000Z",
"source": "oilprice.com",
"categories": [
"general",
"business"
],
"relevance_score": 146.92773
},
{
"uuid": "18afdb1c-7742-4016-bf8c-a2f114e11199",
"title": "Tesla to Enter S&P 500 at Full Weight in December",
"description": "The electric-vehicle maker will be added to the broad stock-...",
"keywords": "Motor Vehicles, Alternative Fuel Vehicles, Trusts Funds Financial Vehicles, Diversified Holding Companies, Automotive",
"snippet": "S&P Dow Jones Indices said it will add Tesla Inc.’s full w...",
"url": "https://www.wsj.com/articles/tesla-to-enter-s-p-500-at-full-weight-in-december-11606780897?mod=pls_whats_news_us_business_f",
"image_url": "https://images.wsj.net/im-265933/social",
"language": "en",
"published_at": "2020-12-01T00:01:00.000000Z",
"source": "online.wsj.com",
"categories": [
"business"
],
"relevance_score": 128.22346
}
]
}
News by UUID Available on: All plans
Endpoint
GET https://api.thenewsapi.com/v1/news/uuid/uuid HTTP/1.1
Use this endpoint to find specific articles by the UUID which is returned on our search endpoints. This is useful if you wish to store the UUID to return the article later.
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
All dates are in UTC (GMT).
HTTP GET Parameters
| name | required | description |
|---|---|---|
api_token |
true | Your API token which can be found on your account dashboard. |
Response Objects
| name | description |
|---|---|
uuid |
The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint. |
title |
The article title. |
description |
The article meta description. |
keywords |
The article meta keywords. |
snippet |
The first 60 characters of the article body. |
url |
The URL to the article. |
image_url |
The URL to the article image. |
language |
The language of the source. |
published_at |
The datetime the article was published. |
source |
The domain of the source. |
categories |
Array of strings which the source is categorized as. |
If no results are found, a resource_not_found error will be returned.
Example Request
GET https://api.thenewsapi.com/v1/news/uuid/147013d8-6c2c-4d50-8bad-eb3c8b7f5740?api_token=YOUR_API_TOKEN
Example Response
{
"uuid": "147013d8-6c2c-4d50-8bad-eb3c8b7f5740",
"title": "These Are The Four American Companies Worth Over $1 Trillion Each – 24",
"description": "America’s major market indexes set records in the early pa...",
"keywords": "",
"snippet": "These Are The Four American Companies Worth Over $1 Trillion...",
"url": "https://247wallst.com/investing/2020/10/17/these-are-the-four-american-companies-worth-over-1-trillion-each/",
"image_url": "https://247wallst.com/wp-content/uploads/2020/08/imageForEntry2-Qrj.jpg",
"language": "en",
"published_at": "2020-10-17T11:16:20.000000Z",
"source": "247wallst.com",
"categories": [
"business"
]
}
Sources Available on: All plans
Endpoint
GET https://api.thenewsapi.com/v1/news/sources HTTP/1.1
Use this endpoint to sources to use in your news API requests. Note that the limit is 50 for all requests.
If you have issues with your requests, please ensure your GET parameters are URL-encoded.
All text data returned is UTF-8.
HTTP GET Parameters
| name | required | description |
|---|---|---|
categories |
false | Comma separated list of categories to include
Example: business,tech
|
exclude_categories |
false | Comma separated list of categories to exclude |
language |
false | Comma separated list of languages to include. Default is all.
Click here for a list of supported languages. Examples: en,es (English + Spanish)
|
page |
false | Use this to paginate through the result set. Default is 1.
Example: page=2
|
Response Objects
| name | description |
|---|---|
meta > found |
The number of sources found for the request. |
meta > returned |
The number of sources returned on the page. |
meta > limit |
The limit is 50. This currently can not be changed. |
meta > page |
The page number based on the page parameter. |
data > source_id |
The unique ID of the source feed. Use this for the source_ids or exclude_source_ids parameters in the news endpoints.
There may be many source_ids for each domain, therefore we would generally suggest using the domains filter instead the source_ids filter. |
data > domain |
The domain of the source. You can use this for the domains or exclude_domains parameters in the news endpoints. |
data > language |
The source language. |
data > locale |
The source locale. Note that only select sources have locales. |
data > categories |
Array of strings which the source is categorized as. |
If no results are found, the data object will be empty.
Example Request
GET https://api.thenewsapi.com/v1/news/sources?api_token=YOUR_API_TOKEN&language=en
Example Response
{
"meta": {
"found": 15453,
"returned": 50,
"limit": 50,
"page": 1
},
"data": [
{
"source_id": "arstechnica.com-1",
"domain": "arstechnica.com",
"language": "en",
"locale": null,
"categories": [
"tech"
]
},
{
"source_id": "adweek.com-1",
"domain": "adweek.com",
"language": "en",
"locale": null,
"categories": [
"business"
]
},
...
Errors
Errors
If your request was unsuccessful, you will receive a JSON formatted error. Below you will find the potential errors you may encounter when using the API.
Errors
| error code | HTTP status | description |
|---|---|---|
malformed_parameters |
400 |
Validation of parameters failed. The failed parameters are usually shown in the error message. |
invalid_api_token |
401 |
Invalid API token. |
usage_limit_reached |
402 |
Usage limit of your plan has been reached. Usage limit and remaining requests can be found on the X-UsageLimit-Limit header. |
endpoint_access_restricted |
403 |
Access to the endpoint is not available on your current subscription plan. |
resource_not_found |
404 |
Resource could not be found. |
invalid_api_endpoint |
404 |
API route does not exist. |
rate_limit_reached |
429 |
Too many requests in the past 60 seconds. Rate limit and remaining requests can be found on the X-RateLimit-Limit header. |
server_error |
500 |
A server error occured. |
maintenance_mode |
503 |
The service is currently under maintenance. |
Example Error Response
{
"error": {
"code": "malformed_parameters",
"message": "The published_before parameter(s) are incorrectly formatted."
}
}
Examples
API Examples
Our endpoints are very useful for filtering to find only specific resources you need. Follow each example request below to see how you can build dynamic queries.
Example Request 1
This is a basic request which will return all articles which match the search term "usd" within the title or body of the article:
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd
Example Request 2
This will return all articles which match the search term "usd" OR "gbp":
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%7C%20gbp
Example Request 3
This will return all articles which match the search term "usd" AND "gbp":
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%2B%20gbp
Example Request 4
This will return all articles which match the search term "usd" AND "gbp" but removes any articles which mentions "cad":
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%2B%20gbp%20-cad
Example Request 5
This will return all articles which match the search term "forex" AND "usd" OR "gbp" but removes any articles which mentions "cad":
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=forex%20%2B%20%28usd%20%7C%20gbp%29%20-cad
Example Request 6
This is the same as Example Request 5 but will also ensure the articles returned are in English and categorized by business or tech but not travel, and are published within the last week:
GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=forex%20%2B%20%28usd%20%7C%20gbp%29%20-cad&language=en&categories=business%2Ctech&exclude_categories=travel&published_after=2026-06-05
Code Examples
See our prepared examples below to quickly get started implementing our API into your next project.
PHP
$queryString = http_build_query([
'api_token' => 'YOUR_API_TOKEN',
'categories' => 'business,tech',
'search' => 'apple',
'limit' => 50,
]);
$ch = curl_init(sprintf('%s?%s', 'https://api.thenewsapi.com/v1/news/all', $queryString));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
$apiResult = json_decode($json, true);
print_r($apiResult);
Python
# Python 3
import http.client, urllib.parse
conn = http.client.HTTPSConnection('api.thenewsapi.com')
params = urllib.parse.urlencode({
'api_token': 'YOUR_API_TOKEN',
'categories': 'business,tech',
'limit': 50,
})
conn.request('GET', '/v1/news/all?{}'.format(params))
res = conn.getresponse()
data = res.read()
print(data.decode('utf-8'))
Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://thenewsapi.com")
baseURL.Path += "v1/news/all"
params := url.Values{}
params.Add("api_token", "YOUR_API_TOKEN")
params.Add("categories", "business,tech")
params.Add("search", "apple")
params.Add("limit", "50")
baseURL.RawQuery = params.Encode()
req, _ := http.NewRequest("GET", baseURL.String(), nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
JavaScript
var requestOptions = {
method: 'GET'
};
var params = {
api_token: 'YOUR_API_TOKEN',
categories: 'business,tech',
search: 'apple',
limit: '50'
};
var esc = encodeURIComponent;
var query = Object.keys(params)
.map(function(k) {return esc(k) + '=' + esc(params[k]);})
.join('&');
fetch("https://api.thenewsapi.com/v1/news/all?" + query, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
C#
var client = new RestClient("https://api.thenewsapi.com/v1/news/all");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddQueryParameter("api_token", "YOUR_API_TOKEN");
request.AddQueryParameter("categories", "business,tech");
request.AddQueryParameter("search", "apple");
request.AddQueryParameter("limit", "50");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
HttpUrl.Builder httpBuilder = HttpUrl.parse("https://api.thenewsapi.com/v1/news/all").newBuilder();
httpBuilder.addQueryParameter("api_token", "YOUR_API_TOKEN");
httpBuilder.addQueryParameter("categories", "business,tech");
httpBuilder.addQueryParameter("search", "apple");
httpBuilder.addQueryParameter("limit", "50");
Request request = new Request.Builder().url(httpBuilder.build()).build();
Response response = client.newCall(request).execute();