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 extract article data from live links, check out articlextractor API .

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: 2024-04-15
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": "7300e0c1-fe34-4087-ad2f-96e11b10e7fa",
                "title": "US highlights role helping Israel thwart Iran attack as Biden coordinates G7 condemnation of Tehran",
                "description": "The United States is highlighting its role in helping Israel thwart an unprecedented aerial attack from Iran.",
                "keywords": "Israel-Hamas war, Iran, United States government, Joe Biden, Israel government, General news, United States, Washington news, w, World news, Israel, G7 Summit, Iran government, Benjamin Netanyahu, Politics, World News",
                "snippet": "WASHINGTON (AP) — The United States on Sunday highlighted its role in helping Israel thwart an unprecedented aerial attack from Iran as President Joe Biden co...",
                "url": "https://apnews.com/article/biden-iran-israel-netanyahu-g7-missiles-drone-62cba0eaac095115f8386397b3ded2f4",
                "image_url": "https://dims.apnews.com/dims4/default/2e6e605/2147483647/strip/true/crop/4896x2754+0+254/resize/1440x810!/quality/90/?url=https%3A%2F%2Fassets.apnews.com%2F23%2F58%2F1d43feaebf634833f2b5690aa4b9%2F266aea3cb0ee4408a3de9af124120a46",
                "language": "en",
                "published_at": "2024-04-14T17:53:02.000000Z",
                "source": "apnews.com",
                "categories": [
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "e7e5187a-4f67-4080-8273-306e2e748290",
                        "title": "Arab nations call for restraint as Israel-Iran conflict intensifies",
                        "description": "Arab governments, already struggling to contain popular fury at the war in Gaza, pleaded for calm after Iran’s drone and missile attacks on Israel.",
                        "keywords": "",
                        "snippet": "ISTANBUL — After Iran launched a retaliatory wave of missiles and drones toward Israel, a rare direct attack by Tehran, much of the Middle East found itself i...",
                        "url": "https://www.washingtonpost.com/world/2024/04/14/iran-israel-conflict-jordan-saudi-arabia/",
                        "image_url": "https://www.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/6LAUBIBDNAAAB73ZH3XEV2ODQE_size-normalized.jpg&w=1440",
                        "language": "en",
                        "published_at": "2024-04-14T20:10:22.000000Z",
                        "source": "washingtonpost.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "bef3d611-e736-4428-a2ec-01807883ba51",
                        "title": "Shadow war no more: Hostilities between Israel and Iran have strayed into direct warfare – is there any going back?",
                        "description": "A long-running conflict between adversaries Israel and Iran fell short of open confrontation – until both countries took more direct aim at each other.",
                        "keywords": "",
                        "snippet": "For decades, Iran and Israel have been engaged in a “shadow war.”\n\nFalling short of direct military confrontation, this conflict has been characterized by w...",
                        "url": "https://theconversation.com/shadow-war-no-more-hostilities-between-israel-and-iran-have-strayed-into-direct-warfare-is-there-any-going-back-227877",
                        "image_url": "https://images.theconversation.com/files/587842/original/file-20240414-16-w91jlr.jpg?ixlib=rb-1.1.0&rect=0%2C177%2C4753%2C2376&q=45&auto=format&w=1356&h=668&fit=crop",
                        "language": "en",
                        "published_at": "2024-04-14T20:54:58.000000Z",
                        "source": "theconversation.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "aa0771d7-4133-4591-9e9f-330c841bb844",
                        "title": "Watch CNBC's Sunday livestream on the Iran-Israel conflict, jumping oil prices and market selloff",
                        "description": "CNBC TV holds a special livestream Sunday evening on the Iran-Israel conflict, spiking oil prices and the stock market decline.",
                        "keywords": "Breaking news, Livestream, Breaking News: Markets, Markets, Iran, Israel, business news",
                        "snippet": "[The stream is slated to start at 6:00 p.m. ET. Please refresh the page if you do not see a player above at that time.]\n\nCNBC's Sunday evening special livestrea...",
                        "url": "https://www.cnbc.com/2024/04/14/watch-cnbcs-sunday-livestream-on-the-iran-israel-conflict-jumping-oil-prices-and-market-selloff.html",
                        "image_url": "https://image.cnbcfm.com/api/v1/image/107397464-17123288132024-04-05t141110z_846127647_rc2e07ava41x_rtrmadp_0_usa-stocks.jpeg?v=1712942703&w=1920&h=1080",
                        "language": "en",
                        "published_at": "2024-04-14T21:06:38.000000Z",
                        "source": "cnbc.com",
                        "categories": [
                            "general",
                            "business"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "52fff462-5bc2-4c17-ab63-1b27eb0a2ba4",
                        "title": "Brian Mast Torches Nancy Pelosi, Democrats for Pre-Iran Attack Demand of Biden to Stop Transfers of Same Weapons Israel Used to Defend Itself",
                        "description": "Rep. Brian Mast (R-FL) is calling out House Democrats who urged the Biden administration to “reconsider” the authorization of an arms package transfer to Israel before Iran's attack.",
                        "keywords": "",
                        "snippet": "Rep. Brian Mast (R-FL) is calling out House Democrats, including former Speaker Nancy Pelosi (D-CA), who urged the Biden administration to “reconsider” the ...",
                        "url": "https://www.breitbart.com/middle-east/2024/04/14/mast-rips-dems-pre-iran-attack-demands-halt-arms-transfers-israel/",
                        "image_url": "https://media.breitbart.com/media/2024/04/GettyImages-2011410206-640x335.jpg",
                        "language": "en",
                        "published_at": "2024-04-14T21:56:17.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "f93ee706-8ab3-4383-bf9c-75c74223a14c",
                        "title": "Video shows Chicago activists cheer after learning Iran launched attack on Israel: 'Hands off Iran!'",
                        "description": "A group of self-described anti-war activists in Chicago cheered when a man announced on Saturday that Iran had launched a barrage of missiles and drones at Israel.",
                        "keywords": "",
                        "snippet": "Self-described anti-war activists in Chicago cheered after learning that Iran had launched hundreds of drones and missiles at Israel on Saturday.\n\nIran launched...",
                        "url": "https://www.foxnews.com/us/video-shows-chicago-activists-cheer-after-learning-iran-launched-attack-israel-hands-off-iran",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/04/Protesters.jpg",
                        "language": "en",
                        "published_at": "2024-04-14T23:36:27.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "7bc66fca-8b66-4596-9e79-026d5aadd4de",
                "title": "The inevitability of Scottie Scheffler winning the 2024 Masters",
                "description": "Scheffler's 2024 Masters performance acted as both a reminder and a warning: This is the best player in the world and he could be just getting started.",
                "keywords": "",
                "snippet": "Open Extended Reactions\n\nAUGUSTA, Ga. -- Sports often produce some of the best underdog stories. We gravitate to them with ease and cherish them while they last...",
                "url": "https://www.espn.com/golf/story/_/id/39944161/scottie-scheffler-dominant-masters-2024-champion-second-green-jacket",
                "image_url": "https://a1.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0414%2Fr1318844_1296x729_16%2D9.jpg",
                "language": "en",
                "published_at": "2024-04-15T03:12:51.000000Z",
                "source": "espn.com",
                "categories": [
                    "sports",
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "9706027b-72fa-4b1e-af40-318424a9b8b9",
                        "title": "Tiger Woods finishes Masters at 16-over 304, a career worst",
                        "description": "Tiger Woods, 48, finished his final round at the Masters in last place at 16-over 304, the worst 72-hole score of his professional career.",
                        "keywords": "",
                        "snippet": "Open Extended Reactions\n\nAUGUSTA, Ga. -- Tiger Woods finished the Masters on Sunday with a record he could do without, walking off the course with a 16-over 304...",
                        "url": "https://www.espn.com/golf/story/_/id/39942176/tiger-woods-finishes-masters-16-304-career-worst",
                        "image_url": "https://a.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0414%2Fr1318848_1296x729_16%2D9.jpg",
                        "language": "en",
                        "published_at": "2024-04-14T19:25:32.000000Z",
                        "source": "espn.com",
                        "categories": [
                            "sports",
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "45f5de43-09c7-4ff7-a93c-7c620c553fff",
                        "title": "Bachelor’s Joey Graziadei, Kelsey Anderson Enjoy a Date at the Masters",
                        "description": "The Bachelor’s Joey Graziadei and Kelsey Anderson enjoyed a date at the Masters",
                        "keywords": "",
                        "snippet": "The Bachelor’s Joey Graziadei and Kelsey Anderson proved their relationship is a hole-in-one while attending The Masters Tournament.\n\n“Bucket list item ✅,...",
                        "url": "https://www.usmagazine.com/celebrity-news/news/bachelors-joey-graziadei-kelsey-anderson-enjoy-a-date-at-the-masters/",
                        "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/04/feature-Bachelors-Joey-Graziadei-and-Kelsey-Anderson-Enjoy-Date-at-the-Masters.jpg?crop=0px%2C20px%2C1334px%2C701px&resize=1200%2C630&quality=86&strip=all",
                        "language": "en",
                        "published_at": "2024-04-14T19:57:37.000000Z",
                        "source": "usmagazine.com",
                        "categories": [
                            "entertainment",
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "d614c8f0-78dd-4d19-a45c-cf0196ae30ea",
                        "title": "Scottie Scheffler wins Masters for 2nd time in his career",
                        "description": "Scottie Scheffler had an incredible final round at Augusta National on Sunday and won the second Masters tournament of his career. He held off Ludvig Åberg and Collin Morikawa.",
                        "keywords": "",
                        "snippet": "Scottie Scheffler held off Ludvig Åberg, Collin Morikawa and Max Homa at Augusta National on Sunday to win the Masters for the second time in his career.\n\nSche...",
                        "url": "https://www.foxnews.com/sports/scottie-scheffler-wins-masters-2nd-time-career",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/04/Scottie-Scheffler7.jpg",
                        "language": "en",
                        "published_at": "2024-04-14T23:09:10.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "afb2e749-79dd-428e-ae39-d3a3a07eecb0",
                        "title": "Scottie Scheffler wins second Masters after final-round 68",
                        "description": "World No. 1 Scottie Scheffler carded a final-round 68 to beat Ludvig Åberg by 4 shots and secure his second Masters title in the last three years.",
                        "keywords": "",
                        "snippet": "Open Extended Reactions\n\nAUGUSTA, Ga. -- A victory at the 2024 Masters seemed inevitable for Scottie Scheffler.\n\nThe Texan has been ranked No. 1 in the world fo...",
                        "url": "https://www.espn.com/golf/story/_/id/39944182/scottie-scheffler-wins-second-masters-final-round-68",
                        "image_url": "https://a2.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0414%2Fgolf_scheff_fc1_16x9.jpg",
                        "language": "en",
                        "published_at": "2024-04-15T00:12:02.000000Z",
                        "source": "espn.com",
                        "categories": [
                            "sports",
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "7597687b-8060-43f4-bfa9-b0c2024a64e4",
                        "title": "Numbers and reactions from Scottie Scheffler's Masters victory",
                        "description": "Here are the best numbers and reactions from Scottie Scheffler's Masters victory.",
                        "keywords": "",
                        "snippet": "Scottie Scheffler shoots a final-round 68 and finishes at 11 under par to win his second career Masters. (0:59)\n\nOpen Extended Reactions\n\nFor the second time in...",
                        "url": "https://www.espn.com/golf/story/_/id/39916654/2024-masters-pga-scottie-scheffler",
                        "image_url": "https://a2.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0414%2Fr1319006_1296x729_16%2D9.jpg",
                        "language": "en",
                        "published_at": "2024-04-15T00:42:48.000000Z",
                        "source": "espn.com",
                        "categories": [
                            "sports",
                            "general"
                        ],
                        "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,keywords
Default: 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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-04-15
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": 1014610,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "12592f07-4d13-4f8f-840b-6c0f1181a5e1",
            "title": "Sudan marks grim one year anniversary of civil war in shadow of Gaza, Ukraine wars",
            "description": "The civil war in Sudan began exactly one year ago, and the warring parties are as likely to sharpen their hatchets as they are to bury them.",
            "keywords": "",
            "snippet": "You’re reading an excerpt from the Today’s WorldView newsletter. Sign up to get the rest free, including news from around the globe and interesting ideas an...",
            "url": "https://www.washingtonpost.com/world/2024/04/15/sudan-one-year-anniversary-gaza-ukraine/",
            "image_url": "https://www.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/IMS6PG5O52SN3K5A7G73WPZEGI.JPG&w=1440",
            "language": "en",
            "published_at": "2024-04-15T04:00:37.000000Z",
            "source": "washingtonpost.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "d30f358b-7c06-4996-b37e-bf50019cbe4f",
            "title": "Drew Carey Explains At Writers Guild Awards Why He Covered Meals For Striking Scribes: “Everybody In This Room Makes Some Actor A Million”",
            "description": "Drew Carey took the stage at the Writers Guild Awards Sunday to say that paying for meals for striking writers last summer was the right thing to do.",
            "keywords": "",
            "snippet": "Drew Carey was able to collect his well-deserved attaboys Sunday at the Writers Guild Awards, where he told the crowd that he covered the bills at Bob’s Big B...",
            "url": "https://deadline.com/2024/04/drew-carey-explains-why-he-for-paid-meals-for-striking-writers-1235885557/",
            "image_url": "https://deadline.com/wp-content/uploads/2024/04/GettyImages-2148645275.jpg?w=1024",
            "language": "en",
            "published_at": "2024-04-15T03:47:09.000000Z",
            "source": "deadline.com",
            "categories": [
                "entertainment"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "7018fbee-5d7e-4f06-b92a-33dda73a9a57",
            "title": "Israel shows aftermath of Iranian attack on airbase (VIDEO)",
            "description": "The Iranian airstrikes have dealt minor damage to one military base, the Israeli military said, releasing video of the repairs",
            "keywords": "",
            "snippet": "Only a few of more than 300 Iranian projectiles made it through the Israeli defenses, the IDF said\n\nThis weekend’s massive Iranian attack has left only cursor...",
            "url": "https://www.rt.com/news/595957-israel-airbase-attack-video/",
            "image_url": "https://mf.b37mrtl.ru/files/2024.04/article/661c9f3320302706a400d8f3.png",
            "language": "en",
            "published_at": "2024-04-15T03:34:09.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "f628d5c6-bff4-4ad0-b810-f7b85033b6f3",
            "title": "Apple iPhone first-quarter shipments sink as Chinese challengers rise; Samsung regains top spot",
            "description": "Among the top five smartphone brands in the report, Apple recorded the sharpest decline year on year.",
            "keywords": "World economy, World Markets, Technology, Breaking News: Technology, Xiaomi Corp, Apple Inc, business news",
            "snippet": "TOPSHOT - The Apple iPhone 15 series is displayed for sale at The Grove Apple retail store on release day in Los Angeles, California, on September 22, 2023. (Ph...",
            "url": "https://www.cnbc.com/2024/04/15/apple-iphone-shipments-sink-as-chinese-challengers-rise-in-q1-idc.html",
            "image_url": "https://image.cnbcfm.com/api/v1/image/107400876-1713145036256-gettyimages-1683374309-AFP_33W86LT.jpeg?v=1713145071&w=1920&h=1080",
            "language": "en",
            "published_at": "2024-04-15T03:33:39.000000Z",
            "source": "cnbc.com",
            "categories": [
                "general",
                "business"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "54f582a0-b37f-4da1-aa9e-d18789ba8545",
            "title": "AI Boom Can Lead To 'Potential Demand Growth' For This Metal, Wall Street Turns Bullish - Apple (NASDAQ:AAPL), Sprott Copper Miners ETF (NASDAQ:COPP)",
            "description": "In a recent shift, Wall Street is demonstrating an increased interest in copper, a trend driven by the metal's growing use in data centers, which are essential ...",
            "keywords": "",
            "snippet": "Loading... Loading...\n\nWall Street is demonstrating an increased interest in copper, a trend driven by the metal’s growing use in data centers, which are esse...",
            "url": "https://www.benzinga.com/news/24/04/38241751/ai-boom-can-lead-to-potential-demand-growth-for-this-metal-wall-street-turns-bullish",
            "image_url": "https://cdn.benzinga.com/files/images/story/2024/04/14/Copper-Shutterstock.jpeg?width=1200&height=800&fit=crop",
            "language": "en",
            "published_at": "2024-04-15T03:17:59.000000Z",
            "source": "benzinga.com",
            "categories": [
                "business"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "49170852-8037-47a5-877c-990f4a095af8",
            "title": "At Least 2 Officers Shot in Heavily Gun-Controlled New York",
            "description": "A Syracuse police officer and an Onondaga County sheriff’s deputy were shot in Salina, New York, Sunday shortly before 9 p.m.",
            "keywords": "",
            "snippet": "A Syracuse police officer and an Onondaga County sheriff’s deputy were shot in Salina, New York, Sunday shortly before 9 p.m.\n\nSalina is a suburb of Syracuse,...",
            "url": "https://www.breitbart.com/2nd-amendment/2024/04/14/atleast-two-officers-shot-heavily-gun-controlled-new-york/",
            "image_url": "https://media.breitbart.com/media/2019/01/police-tape-line.png",
            "language": "en",
            "published_at": "2024-04-15T03:14:42.000000Z",
            "source": "breitbart.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "7bc66fca-8b66-4596-9e79-026d5aadd4de",
            "title": "The inevitability of Scottie Scheffler winning the 2024 Masters",
            "description": "Scheffler's 2024 Masters performance acted as both a reminder and a warning: This is the best player in the world and he could be just getting started.",
            "keywords": "",
            "snippet": "Open Extended Reactions\n\nAUGUSTA, Ga. -- Sports often produce some of the best underdog stories. We gravitate to them with ease and cherish them while they last...",
            "url": "https://www.espn.com/golf/story/_/id/39944161/scottie-scheffler-dominant-masters-2024-champion-second-green-jacket",
            "image_url": "https://a1.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0414%2Fr1318844_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-04-15T03:12:51.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "26285fcd-22a1-4a0c-8f6c-5d80168700e3",
            "title": "Report: Iranian General Killed in Israeli Airstrike Helped Plan, Execute Hamas Oct. 7 Attack",
            "description": "An Iranian general, assassinated in an Israeli airstrike, had reportedly been involved in the \"planning and execution\" of the Oct. 7 attack.",
            "keywords": "",
            "snippet": "A senior Iranian general with the Islamic Revolutionary Guard Corps (IRGC) who was assassinated in an Israeli airstrike at the beginning of April had reportedly...",
            "url": "https://www.breitbart.com/middle-east/2024/04/14/report-iranian-general-killed-israeli-airstrike-involved-planning-execution-hamas-oct-7-attack/",
            "image_url": "https://media.breitbart.com/media/2024/04/Mohammad-Reza-Zahedi-Iran-Apr-5-2024-getty-640x335.jpg",
            "language": "en",
            "published_at": "2024-04-15T03:04:30.000000Z",
            "source": "breitbart.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "5db9ab27-7005-450d-9226-743115303035",
            "title": "Houston Dash record-signing Maria Sanchez requests trade",
            "description": "Houston Dash winger Maria Sanchez has requested a trade only four months after signing one of the most lucrative deals in National Women's Soccer League history...",
            "keywords": "",
            "snippet": "María Sánchez says she's proud to be a leader in encouraging more Mexican female players in the NWSL after her record-breaking move to Houston Dash. (1:34)\n\nO...",
            "url": "https://www.espn.com/soccer/story/_/id/39943336/houston-dash-maria-sanchez-requests-trade",
            "image_url": "https://a3.espncdn.com/combiner/i?img=%2Fphoto%2F2023%2F0324%2Fr1149372_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-04-15T02:56:38.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "6f29159f-c3d0-4bb8-b31b-94070e43a82e",
            "title": "Transfer Talk: Serie A clubs circle forgotten Liverpool star Fábio Carvalho",
            "description": "Liverpool midfielder Fábio Carvalho is attracting interest from Italy after impressing on loan at Hull City. Transfer Talk has the latest.",
            "keywords": "",
            "snippet": "Open Extended Reactions\n\nThe summer transfer window won't reopen in Europe for a while yet, but there are plenty of moves in the works and gossip swirling aroun...",
            "url": "https://www.espn.com/soccer/story/_/id/39945150/transfer-talk-serie-clubs-circle-forgotten-liverpool-star-fabio-carvalho",
            "image_url": "https://a1.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0415%2Fr1319072_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-04-15T02:54:21.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "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,keywords
Default: 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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-04-15
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": 49264551,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "7c98891f-eca5-42dc-b7e7-00c323c4be96",
            "title": "Iza revela susto após descobrir gravidez: 'Médico pediu para ficar quieta'",
            "description": "Iza, 33, revelou detalhes de sua gravidez, anunciada na última quarta-feira (10). Ao \"Fantástico\", ela afirmou ter passado por um susto.",
            "keywords": "",
            "snippet": "Iza, 33, revelou detalhes de sua gravidez, anunciada na última quarta-feira (10). Ao \"Fantástico\", ela afirmou ter passado por um susto durante o período em ...",
            "url": "https://www.uol.com.br/splash/noticias/2024/04/14/iza-revela-susto-apos-descobrir-gravidez-medico-pediu-para-ficar-quieta.htm",
            "image_url": "https://conteudo.imguol.com.br/c/entretenimento/5f/2024/04/14/iza-revelou-detalhes-de-sua-primeira-gravidez-em-entrevista-ao-fantastico-1713142766423_v2_615x300.jpg",
            "language": "pt",
            "published_at": "2024-04-15T04:11:20.000000Z",
            "source": "uol.com.br",
            "categories": [
                "tech",
                "science"
            ],
            "relevance_score": null
        },
        {
            "uuid": "7945e758-831a-409a-ac6f-a0a89d9ffdf0",
            "title": "Myanmar New Year Festival in Tokyo",
            "description": "The Myanmar community in Tokyo gathered in Koto Ward on Sunday to celebrate the Myanmar New Year, marked annually on April 17th. The festival, known as",
            "keywords": "",
            "snippet": "TOKYO, Apr 15 (News On Japan) - The Myanmar community in Tokyo gathered in Koto Ward on Sunday to celebrate the Myanmar New Year, marked annually on April 17th....",
            "url": "https://newsonjapan.com/article/141632.php",
            "image_url": "https://newsonjapan.com/images/article/141632.jpg",
            "language": "en",
            "published_at": "2024-04-15T04:11:03.000000Z",
            "source": "newsonjapan.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "48f695f6-bb0c-4f15-8571-df2cfb6746a2",
            "title": "Más de $53 millones de dólares en cannabis ilegal son incautados en California",
            "description": "Los operativos se ejecutaron del 1 de enero al 31 de marzo de 2024 en los condados de Los Ángeles, Orange, Alameda, Fresno, Kern, Riverside y San Joaquín",
            "keywords": "",
            "snippet": "Más de $53 millones de dólares en cannabis ilegal fueron incautados durante una reciente campaña de represión por parte de las autoridades de California.\n\nL...",
            "url": "https://laopinion.com/2024/04/15/mas-de-53-millones-de-dolares-en-cannabis-ilegal-son-incautados-en-california/",
            "image_url": "https://laopinion.com/wp-content/uploads/sites/3/2024/04/AP19234725938683.jpg?w=1200",
            "language": "es",
            "published_at": "2024-04-15T04:07:35.000000Z",
            "source": "laopinion.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "a05869b0-949e-4031-9e77-54e336c312d5",
            "title": "北白川疏水から「リーボン」へ: 京都を歩くアルバム",
            "description": "過去の全記事  2006年1月27日から毎日更新しています。※写真は全てクリッ...",
            "keywords": "",
            "snippet": "",
            "url": "http://kyoto-albumwalking2.cocolog-nifty.com/blog/2024/04/post-eb5064.html",
            "image_url": "http://kyoto-albumwalking2.cocolog-nifty.com/.shared-cocolog/nifty_managed/images/web/ogp/default.png",
            "language": "ja",
            "published_at": "2024-04-15T04:07:14.000000Z",
            "source": "kyoto-albumwalking2.cocolog-nifty.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "05c97ab2-52e5-4e59-90de-44b207fa7e9b",
            "title": "Nazem Kadri helps Flames rally to edge Coyotes",
            "description": "Nazem Kadri scored the tying and winning goals in the third period while also adding an assist on Sunday night to lead the Calgary Flames to a 6-5 comeback vict...",
            "keywords": "",
            "snippet": "Sign in to Sportsnet\n\nSign In Sign Up\n\nFirst Name {* traditionalRegistration_firstName *} {* traditionalRegistration_firstName *} Last Name {* traditionalRegist...",
            "url": "https://www.sportsnet.ca/nhl/article/nazem-kadri-helps-flames-rally-to-edge-coyotes/",
            "image_url": "https://www.sportsnet.ca/wp-content/uploads/2024/04/Kadri-1-1040x572.jpg",
            "language": "en",
            "published_at": "2024-04-15T04:06:45.000000Z",
            "source": "sportsnet.ca",
            "categories": [
                "sports"
            ],
            "relevance_score": null
        },
        {
            "uuid": "448b95a6-0eeb-4150-952c-f0389c34b835",
            "title": "腓特烈·卡尔 フリードリヒ・カール(アズールレーン)",
            "description": "",
            "keywords": "",
            "snippet": "",
            "url": "https://gmgard.com/gm125632",
            "image_url": "https://gmgard.com/favicon.ico",
            "language": "ja",
            "published_at": "2024-04-15T04:06:09.000000Z",
            "source": "gmgard.com",
            "categories": [
                "health"
            ],
            "relevance_score": null
        },
        {
            "uuid": "1be7fff9-2486-40ee-8d88-ab559691245a",
            "title": "紳士の庭 ♢绅士们的二次元资源分享交流平台♢",
            "description": "gmgard.com♢紳士の庭♢ 绅士们的二次元资源分享交流平台",
            "keywords": "",
            "snippet": "",
            "url": "https://gmgard.com/Error/Index/404?prev=%2Fgm125631",
            "image_url": "https://gmgard.com/favicon.ico",
            "language": "ja",
            "published_at": "2024-04-15T04:06:09.000000Z",
            "source": "gmgard.com",
            "categories": [
                "health"
            ],
            "relevance_score": null
        },
        {
            "uuid": "66373b0f-c087-4bf4-8252-70ef13df22e5",
            "title": "丸い、丸すぎる...! 「いなり寿司カット」のトイプーさんが漫画みたいで超ラブリー|Jタウンネット",
            "description": "「ポテトを運搬する骨付き肉」そんなつぶやきと共に、1匹のポメラニアンの姿がX上に投稿された。丸、登場!(画像?...",
            "keywords": "動物ネタ, 犬",
            "snippet": "",
            "url": "https://j-town.net/2024/04/15356160.html",
            "image_url": "https://cdn.j-town.net/thumbnail/2024/04/town20240414172330_large.jpeg",
            "language": "ja",
            "published_at": "2024-04-15T04:05:50.000000Z",
            "source": "j-town.net",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "3b934065-8ed7-4dbb-a44a-65472dac4f91",
            "title": "20240409月季花开了",
            "description": "今天一天的好心情就在于阳台上的月季花开啦!啦啦啦啦,真的,昨天晚上看还是花苞,今天早上就已经是打开状态了! ...",
            "keywords": "",
            "snippet": "",
            "url": "https://www.jianshu.com/p/8fbf701c82ac",
            "image_url": "https://upload-images.jianshu.io/upload_images/3497621-dc516437c31f9f25.jpg",
            "language": "zh",
            "published_at": "2024-04-15T04:05:44.000000Z",
            "source": "jianshu.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "0cf6c39a-6f13-420e-aa41-9d9415b77fb9",
            "title": "26. 删除排序数组中的重复项",
            "description": "26. 删除排序数组中的重复项 题目链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-arr...",
            "keywords": "",
            "snippet": "",
            "url": "https://www.jianshu.com/p/5d6deb33d0bf",
            "image_url": "https://upload.jianshu.io/users/upload_avatars/28346185/6372c4ce-9413-43b8-8349-8d862705fb7c",
            "language": "zh",
            "published_at": "2024-04-15T04:05:44.000000Z",
            "source": "jianshu.com",
            "categories": [],
            "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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
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: 2024-04-15T04:13:49 | 2024-04-15T04:13 | 2024-04-15T04 | 2024-04-15 | 2024-04 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-04-15
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=2024-04-08
    

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();
    

More

Stock Market News APIs

We also provide a dedicated finance and stock market news and analysis API, perfect for financial apps. Check it out here: marketaux.com.