>

Documentation

Here you have detailed documentation of all available API functions. To get started, you can make the sample request for each endpoint, download an SDK, or run in Postman (see bottom of left navigation).

Search News

Search and filter news by text, date, location, language, and more. The API returns a list of news articles matching the given criteria. You can set as many filtering parameters as you like but you have to set at least one, e.g. text or language.

GET
https://api.worldnewsapi.com/search-news
Example Request and Response
GET
https://api.worldnewsapi.com/search-news?text=tesla&language=en
{
  "offset": 0,
  "number": 10,
  "available": 83,
  "news": [
    {
      "id": 28,
      "title": "Tesla to Release a Four-Motor Version of Cybertruck",
      "text": "Tesla CEO Elon Musk has revealed new details about the upcoming Cybertruck electric pickup truck, the mass production of which was delayed until 2023 because of the lack of components and a lot of complex technologies that need to be scaled up. According to Musk, the initial production of the electric pickup truck will begin with a four-motor variant with “independent, ultra fast response torque control of each wheel,” the tweet reads. In response, Twitter users asked if the Cybertruck could turn like a tank. Musk said that thanks to both the rear and front wheel steer, the electric truck will not only be able to turn like a tank, but also drive diagonally like a crab. According to Electrek, this change could be Tesla's reaction to what its competitors do. Since the introduction of Tesla’s novelty, the market for electric pickup trucks has significantly evolved. Currently, one electric pickup on the market can turn like a tank – the Rivian R1T, while GMC's Hummer EV can drive diagonally. Following the announcement of Tesla Cybertruck in 2019, the company announced three configurations of the pickup truck: the entry-level model with one motor, the one with two motors, and the one with three. Rumor has it that the company intends to abandon the single-motor version altogether. In this case, Tesla Cybertruck will be sold with two, three, and four motors. Musk has promised to provide an update on the pickup's roadmap on the next earnings call. The production of Tesla Cybertruck is expected to begin at the end of 2022, and its mass production is slated to start in 2023.",
      "summary": "Tesla CEO Elon Musk has revealed new details about the upcoming Cybertruck electric pickup truck. According to Musk, its initial production will begin with a four-motor variant.",
      "url": "https://internetprotocol.co/hitech/2021/12/07/tesla-to-release-a-four-motor-cybertruck/",
      "image": "https://internetprotocol.co/content/images/2021/12/Tesla-to-Release-a-Four-Motor-Version-of-Cybertruck.png",
      "publish_date": "2022-09-30 01:07:48",
      "authors": [
        "Iwan Stone",
        "Zahna Eklund"
      ],
      "language": "en",
      "source_country": "co",
      "sentiment": 0.712523
    },...
  ]
}

Extract News

Extract a news article from a website to a well structure JSON object.

GET
https://api.worldnewsapi.com/extract-news
Example Request and Response
GET
https://api.worldnewsapi.com/extract-news?analyze=true&url=https%3A%2F%2Finternetprotocol.co%2Fhitech%2F2021%2F12%2F07%2Ftesla-to-release-a-four-motor-cybertruck%2F
{
  "title": "Tesla to Release a Four-Motor Version of Cybertruck",
  "text": "Tesla CEO Elon Musk has revealed new details about the upcoming Cybertruck electric pickup truck, the mass production of which was delayed until 2023 because of the lack of components and a lot of complex technologies that need to be scaled up. According to Musk, the initial production of the electric pickup truck will begin with a four-motor variant with “independent, ultra fast response torque control of each wheel,” the tweet reads. In response, Twitter users asked if the Cybertruck could turn like a tank. Musk said that thanks to both the rear and front wheel steer, the electric truck will not only be able to turn like a tank, but also drive diagonally like a crab. According to Electrek, this change could be Tesla's reaction to what its competitors do. Since the introduction of Tesla’s novelty, the market for electric pickup trucks has significantly evolved. Currently, one electric pickup on the market can turn like a tank – the Rivian R1T, while GMC's Hummer EV can drive diagonally. Following the announcement of Tesla Cybertruck in 2019, the company announced three configurations of the pickup truck: the entry-level model with one motor, the one with two motors, and the one with three. Rumor has it that the company intends to abandon the single-motor version altogether. In this case, Tesla Cybertruck will be sold with two, three, and four motors. Musk has promised to provide an update on the pickup's roadmap on the next earnings call. The production of Tesla Cybertruck is expected to begin at the end of 2022, and its mass production is slated to start in 2023.",
  "url": "https://internetprotocol.co/hitech/2021/12/07/tesla-to-release-a-four-motor-cybertruck/",
  "image": "https://internetprotocol.co/content/images/2021/12/Tesla-to-Release-a-Four-Motor-Version-of-Cybertruck.png",
  "publish_date": "2022-09-30 01:07:48",
  "author": "Kay Lee",
  "language": "en",
  "source_country": "co",
  "sentiment": 0.712523
}

Extract News Links

Extract a news links from a news website.

GET
https://api.worldnewsapi.com/extract-news-links
Example Request and Response
GET
https://api.worldnewsapi.com/extract-news-links?url=https://www.nytimes.com
{
  "news_links": [
    "https://www.nytimes.com/2023/10/07/opinion/wnba-liberty-championship.html",
    "https://www.nytimes.com/2023/10/08/business/economy/labor-strikes.html",
    "https://www.nytimes.com/2023/10/08/dining/sunday-calls-for-old-fashioned-beef-stew.html",
    ...
  ]
}

News Website to RSS Feed

Turn a news website into an RSS feed. Any page of a news website can be turned into an RSS feed. Provide the URL to the page and the API will return an RSS feed with the latest news from that page.

GET
https://api.worldnewsapi.com/feed.rss
Example Request and Response
GET
https://api.worldnewsapi.com/feed.rss?url=https://www.aljazeera.com/europe/
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Europe News | Today's latest from Al Jazeera</title>
        <link>https://www.aljazeera.com/europe/</link>
        <lastBuildDate>Sun, 08 Oct 2023 23:16:44 +0000</lastBuildDate>
        <pubDate>Sun, 08 Oct 2023 23:16:44 +0000</pubDate>
        <item>
            <title>Martinelli Fires Arsenal To Late 1 0 Win Over Manchester City</title>
            <link>https://www.aljazeera.com/sports/2023/10/8/martinelli-fires-arsenal-to-late-1-0-win-over-manchester-city</link>
            <guid isPermaLink="true">https://www.aljazeera.com/sports/2023/10/8/martinelli-fires-arsenal-to-late-1-0-win-over-manchester-city</guid>
            <atom:link href="https://www.aljazeera.com/sports/2023/10/8/martinelli-fires-arsenal-to-late-1-0-win-over-manchester-city"/>
        </item>
        ...
    </channel>
</rss>

Get Geo Coordinates

Retrieve the latitude and longitude of a location name. Given this information you can fill the location-filter parameter in the news search endpoint.

GET
https://api.worldnewsapi.com/geo-coordinates
Example Request and Response
GET
https://api.worldnewsapi.com/geo-coordinates?location=Tokyo%2C%20Japan
{
  "latitude": 35.652832,
  "longitude": 139.839478,
  "city": "Tokyo"
}

Why a News API

In today's world, staying informed about current events and news is essential. News is the primary source of information that keeps people updated with the latest happenings around the world. Whether it is politics, business, sports, entertainment, or any other field, news plays a vital role in shaping our understanding of the world. With the rapid advancements in technology, the traditional ways of consuming news have been revolutionized. News APIs are one such technological advancement that has made the process of accessing news much more efficient and effective.

A News API is a web service that allows developers to access and integrate news articles and related data into their applications. These APIs provide developers with a structured and standardized way to access news data from multiple sources, including news organizations, social media, and other online platforms. With the help of a News API, developers can create customized news applications that cater to the specific needs of their users.

One of the main advantages of using a News API is that it allows developers to build interesting and innovative applications that can provide users with personalized news content. For instance, a developer can build a news aggregator app that uses a News API to pull in news from various sources and filter it based on the user's interests. This way, users can get news that is relevant to their interests without having to sift through irrelevant information.

Another example of how a News API can be leveraged is to create a news bot that can provide users with news updates on a specific topic or category. For instance, a developer can create a bot that provides users with the latest news on technology, sports, or politics. This type of application can be particularly useful for busy individuals who don't have the time to keep up with the news on their own.

A News API can also be used to create data visualizations and infographics that provide users with a more engaging and interactive way to consume news. For example, a developer can use a News API to pull in data on global climate change and create a data visualization that shows how temperatures have changed over time. This type of application can be useful for journalists, researchers, and policymakers who need to understand complex data in a more accessible way.

Furthermore, News APIs can also be leveraged to create sentiment analysis tools that analyze the tone and sentiment of news articles. This can be useful for companies and organizations that need to track their brand reputation or monitor public opinion on specific issues. For instance, a company can use a News API to analyze news articles about their brand and track sentiment over time.

In conclusion, News APIs have revolutionized the way news is consumed and accessed by users. With the help of a News API, developers can build customized applications that provide users with personalized news content. These applications can range from news aggregators to data visualizations and sentiment analysis tools. By leveraging a News API, developers can create innovative applications that cater to the specific needs of their users and provide them with a more engaging and interactive way to consume news.

Semantic Types

The news search API allows you to filter and search for semantic entities. Entities are concepts that share a specific meaning but can be addressed with different names. For example, the entity "USA" has alternative names such as "US" or "United States of America" but they all refer to the same country.

When filtering for news by a certain entity, you don't have to worry about the synonym to use as the API will normalize it and find all instances of the concept regardless of the synonym you use. For example, it makes no difference whether you search for LOC:USA or LOC:United States of America

The following table shows all supported types with examples of how to use them in the entities filter in the news search endpoint.

Type Code Example
Location LOC LOC:Ireland
Person PER PER:Michael Jordan
Organization ORG ORG:Tesla

Language Codes

Language Code (ISO 6391)
Afar aa
Amharic am
Arabic ar
Bengali bn
Bosnian bs
Bulgarian bg
Burmese my
Chinese zh
Croatian hr
Czech cs
Danish da
Dutch nl
English en
Estonian et
Finnish fi
French fr
German de
Greek el
Hebrew he
Hindi hi
Hungarian hu
Icelandic is
Indonesian id
Italian it
Japanese ja
Korean ko
Lao lo
Latvian lv
Lithuanian lt
Macedonian mk
Malay ms
Maltese mt
Marathi mr
Māori mi
Nepali ne
Norwegian nb
Norwegian no
Persian fa
Polish pl
Portuguese pt
Romanian ro
Russian ru
Serbian sr
Sinhalese si
Slovak sk
Slovene sl
Somali so
Spanish es
Swedish sv
Tajik tg
Tamil ta
Telugu te
Thai th
Turkish tr
Ukrainian uk
Urdu ur
Uzbek uz
Vietnamese vi

News Sources

The following list shows supported news sources. The list is growing and might not be complete.

If any source is missing, write us.

  • cnn.com
  • bbc.co.uk
  • channel4.com
  • vox.com
  • traxnews.org
  • 247newsaroundtheworld.com
  • blogspot.com
  • reviewminute.com
  • theasialive.com
  • breakingasia.com
  • globalissues.org
  • gudstory.com
  • theunionjournal.com
  • zimonews.com
  • egyptian-gazette.com
  • cbslocal.com
  • cyberethiopia.com
  • karennews.org
  • afgha.com
  • informalnewz.com
  • maoritelevision.com
  • focusguinee.info
  • revuemag.com
  • go.com
  • biv.com
  • timesofnews.com
  • chinafilminsider.com
  • cocorioko.net
  • connachttribune.ie
  • dailyfinland.fi
  • eldjazaironline.dz
  • chosun.com
  • elpais.com
  • expresochiapas.com
  • lastampa.it
  • dahaboo.com
  • beijingbulletin.com
  • dublinnews.com
  • breitbart.com
  • express.co.uk
  • euronews.com
  • financialpost.com
  • independentaustralia.net
  • ndtv.com
  • ruralnewsgroup.co.nz
  • scroll.in
  • socialsamosa.com
  • time.com
  • foxnews.com
  • news24.com
  • sky.com
  • sydneysun.com
  • thejapannews.net
  • t-online.de
  • washingtonpost.com
  • gp.se
  • finlandtoday.fi
  • greenlandtoday.com
  • grupometropoli.net
  • ifpnews.com
  • imparcialoaxaca.mx
  • indaily.com.au
  • lesoleil.sn
  • levenementprecis.com
  • \N
  • montserrat-newsletter.com
  • mvariety.com
  • naimexico.com
  • zeit.de
  • newuthayan.com
  • rivira.lk
  • cbc.ca
  • lankapuvath.lk
  • standardtimespress.org
  • tass.com
  • theconversation.com
  • theforeigner.no
  • theresident.eu
  • timesofsandiego.com
  • trinidadexpress.com
  • tvm.mr
  • 9news.com.au
  • acn.cu
  • adaderana.lk
  • addisadmassnews.com
  • aljazeera.com
  • aopnews.com
  • asiatoday.com
  • bahrainmirror.com
  • barrierestarjournal.com
  • bbs.bt
  • burnslakelakesdistrictnews.com
  • businessnews.com.au
  • cambridge-news.co.uk
  • campbellrivermirror.com
  • channelnewsasia.com
  • ctvnews.ca
  • dailymail.co.uk?ns_mchannel=rss&ns_campaign=1490&ito=1490
  • daily-mail.co.zm
  • diariosigloxxi.com
  • digitalmarket.asia
  • ekonomist.rs
  • elvocero.com
  • financialexpress.com
  • guampdn.com
  • hitsfm.com.np
  • huffingtonpost.co.uk
  • independent.co.uk
  • industryandbusiness.ie
  • inp.net.pk
  • kelownacapnews.com
  • kimberleybulletin.com
  • koreaherald.com
  • langleyadvancetimes.com
  • lesahel.org
  • madonline.com
  • follow.it
  • metrotimes.com
  • mirror.co.uk
  • newsonjapan.com
  • newsweek.com
  • npr.org
  • peacearchnews.com
  • politico.com
  • riverfronttimes.com
  • sana.sy
  • seychellesnewsagency.com
  • slguardian.org
  • smh.com.au
  • standard.co.uk
  • sunnysouthnews.com
  • tamtaminfo.com
  • techcentral.ie
  • thestar.com
  • theweek.com
  • times.co.sz
  • times.co.zm
  • tribune242.com
  • tv6tnt.com
  • tvr.ro
  • uzreport.com
  • vernonmorningstar.com
  • virginislandsdailynews.com
  • voxy.co.nz
  • washingtontimes.com
  • youngchinabiz.com
  • cbn.com
  • or.jp
  • 8columnas.com.mx
  • abc13.com
  • abc7news.com
  • addisfortune.news
  • addisstandard.com
  • adevarul.ro
  • australianjewishnews.com
  • press.ma
  • albiladdaily.com
  • alicespringsnews.com.au
  • allafrica.com
  • amap.ml
  • amnestynepal.org
  • antigua-barbuda.com
  • antiguaobserver.com
  • sverigesradio.se
  • articleify.com
  • nikkei.com
  • asianmilitaryreview.com
  • astanatimes.com
  • atop.tg
  • aujourdhui.ma
  • barbadostoday.bb
  • benininfo.com
  • bernews.com
  • burkina24.com
  • business-review.eu
  • calgaryherald.com
  • calgarysun.com
  • canal4rd.com
  • carnewschina.com
  • chinaglobalsouth.com
  • china-underground.com
  • cphpost.dk
  • cpj.org
  • crowdwisdom.live
  • libsyn.com
  • dailypost.ng
  • dailytimes.com.pk
  • kyiv.ua
  • dayakdaily.com
  • diario.mx
  • elmundo.es
  • e27.co
  • economist.com.na
  • edmontonjournal.com
  • edmontonsun.com
  • elbcradio.com
  • eldeforma.com
  • eleftherostypos.gr
  • elperiodico.com.gt
  • desk-russie.eu
  • mehrnews.com
  • mercopress.com
  • kyodonews.net
  • radio.cz
  • englishrussia.com
  • ethsat.com
  • podbean.com
  • chandigarhcitynews.com
  • nezavisne.com
  • sdpnoticias.com
  • thelocal.com
  • fraternitenews.info
  • gcn.ie
  • globalnews.ca
  • globalpressjournal.com
  • gothamist.com
  • groupelavenir.org
  • guineenews.org
  • guyanachronicle.com
  • haitiantimes.com
  • homesandinteriorsscotland.com
  • hongkongfp.com
  • hrmasia.com
  • ialtchad.com
  • imemc.org
  • wordpress.com
  • philenews.com
  • independent.ng
  • indianexpress.com
  • indiannewsqld.com.au
  • indiaobservers.com
  • internetprotocol.co
  • itb.com
  • ittn.ie
  • japaninsides.com
  • japantoday.com
  • jurnalul.ro
  • kalkinemedia.com
  • kayhan.ir
  • khabar.kz
  • khmertv.com
  • kosovapress.com
  • krooknews.com
  • kurier.at
  • kwttoday.com
  • lanka24news.com
  • leaderpost.com
  • leadership.ng
  • lenews.ch
  • andavamamba.com
  • live24.lk
  • lnr.org.la
  • londonjournal.co.uk
  • lovefm.com
  • lzinios.lt
  • makfax.com.mk
  • maldivesindependent.com
  • mb.com.ph
  • mediaindonesia.com
  • mediapermata.com.bn
  • meduza.io
  • mexiconewsdaily.com
  • mmbiztoday.com
  • monacolife.net
  • mondediplo.com
  • montrealgazette.com
  • munichnow.com
  • myawady.net.mm
  • nation.com.pk
  • nation.lk
  • nationalpost.com
  • news.ai
  • google.com
  • livedoor.com
  • ltn.com.tw
  • stv.tv
  • news4masses.com
  • newsblare.com
  • newsday.co.tt
  • newsin.asia
  • newsnblogs.com
  • newsnet.scot
  • nypost.com
  • oakvillenews.org
  • obn.ba
  • observer.com
  • globo.com
  • ortb.bj
  • ottawacitizen.com
  • ottawasun.com
  • ozzienews.com
  • pbsguam.org
  • peru.com
  • pina.com.fj
  • politiken.dk
  • pridnestrovie-daily.net
  • freepressjournal.in
  • thequint.com
  • punchng.com
  • quintdaily.com
  • rabble.ca
  • rightwirereport.com
  • sueddeutsche.de
  • idnes.cz
  • shabait.com
  • sic.pt
  • sloveniatimes.com
  • sltn.co.uk
  • sluggerotoole.com
  • smallwarsjournal.com
  • soranews24.com
  • southeastasiaglobe.com
  • sme.sk
  • splash247.com
  • standforfreedom.ca
  • starofmysore.com
  • startupreporter.in
  • abc.es
  • stcroixsource.com
  • sudantribune.com
  • thechinaproject.com
  • tribunnews.com
  • surgezirc.co.uk
  • talkingupscotlandtwo.com
  • taz.de
  • technode.com
  • thebridge.jp
  • thediplomat.com
  • thefrontierpost.com
  • thegambiaradio.com
  • theintercept.com
  • theiranproject.com
  • thenassauguardian.com
  • thenewdawnliberia.com
  • thenewshimachal.com
  • theorkneynews.scot
  • theparisnews.com
  • theprovince.com
  • thestandard.org.nz
  • thestarphoenix.com
  • tibettimes.net
  • ticotimes.net
  • tiempo.hn
  • times.mw
  • indiatimes.com
  • togopresse.tg
  • citynews.ca
  • torontosun.com
  • uacrisis.org
  • urbana.com.py
  • uscnpm.org
  • vancouversun.com
  • vanguardia.com.mx
  • vecer.mk
  • villagemagazine.ie
  • vladnews.ru
  • vob929.com
  • voxeurop.eu
  • wan-ifra.org
  • warontherocks.com
  • warritatafo.com
  • whdh.com
  • gazeta.pl
  • windsorstar.com
  • wsvn.com
  • 24chasa.bg
  • 24-horas.mx
  • 24sata.hr
  • abbynews.com
  • abc.net.au
  • acap.cf
  • adworld.ie
  • aftenposten.no
  • agassizharrisonobserver.com
  • agriland.ie
  • aib.media
  • alalam.ma
  • albayan.ae
  • albayan.aehttps
  • aletihad.ae
  • altoadige.it
  • amnesty.org
  • aninews.in
  • anphoblacht.com
  • apnlive.com
  • artscouncil.ie
  • asianexpress.co.uk
  • asiasentinel.com
  • autonews.com
  • northernirelandworld.com
  • belfastlive.co.uk
  • bhaskarlive.in
  • bhutannewsservice.org
  • bordertelegraph.com
  • boston.com
  • bostonherald.com
  • breakingnewstoday.co.uk
  • brookings.edu
  • buchanobserver.co.uk
  • budapesttimes.hu
  • business-standard.com
  • campaignasia.com
  • canberratimes.com.au
  • capital.bg
  • capitalqueretaro.com.mx
  • osvnews.com
  • cbsnews.com
  • ceskenoviny.cz
  • challenge.ma
  • chanarcillo.cl
  • chicagotribune.com
  • chinaentertainmentnews.com
  • chosonsinbo.com
  • churchofscotland.org.uk
  • thecjn.ca
  • cnbc.com
  • computerworld.com
  • costa-news.com
  • cricketireland.ie
  • crtv.cm
  • ctitv.com.tw
  • cubanet.org
  • dailyexcelsior.com
  • dailyherald.com
  • dailyheraldtribune.com
  • dailynews.co.th
  • dailypolitics.com
  • dailypost.vu
  • dailyrecord.co.uk
  • danas.rs
  • dayniiile.com
  • dbsuriname.com
  • deadlinenews.co.uk
  • debate.com.mx
  • deccanchronicle.com
  • delfi.lv
  • derryjournal.com
  • deutschland.de
  • diariocolatino.com
  • gouv.fr?xtor=RSS-1
  • dnaindia.com
  • dnevnik.bg
  • dnevnik.si
  • donegaldaily.com
  • dv.is
  • eastasiaforum.org
  • easternherald.com
  • scotsman.com
  • efe.com
  • egyptindependent.com
  • elcorreo.com
  • eldiario.com.co
  • eldiario.net
  • elfinanciero.com.mx
  • elnorte.com
  • elsiglodetorreon.com.mx
  • eluniversal.com.mx
  • el-universal.com
  • emirates247.com
  • ena.et
  • esmitv.com
  • europeantimes.news
  • expatica.com
  • fanabc.com
  • faz.net
  • financeasia.com
  • firstpostofindia.com
  • fleet.ie
  • france24.com
  • francetvinfo.fr
  • ft.com
  • glasgowlive.co.uk
  • glasgowtimes.co.uk
  • globes.co.il
  • gnlm.com.mm
  • goulburnpost.com.au
  • atom.xml
  • gov.br
  • grampianonline.co.uk
  • grenadabroadcast.com
  • grimsbytelegraph.co.uk
  • gs.by
  • handelsblatt.com
  • headlinesoftoday.com
  • helsinkitimes.fi
  • heraldscotland.com
  • hoy.es
  • huffpost.com
  • iaasiaonline.com
  • ibtimes.com.au
  • ilmattino.it
  • ilmessaggero.it
  • ilsole24ore.com
  • iltalehti.fi
  • iltempo.it
  • independent.ie
  • indiatoday.in
  • inform.kz
  • informador.mx
  • insider.co.uk
  • interfax.ru
  • inverness-courier.co.uk
  • iraqhurr.org
  • irish-boxing.com
  • irishbuildingmagazine.ie
  • irishcentral.com
  • irishmirror.ie
  • irishtimes.com
  • islandsun.com
  • itnnews.lk
  • ittefaq.com.bd
  • iwacu-burundi.org
  • iwnsvg.com
  • japantimes.co.jp
  • jasarat.com
  • jornada.com.mx
  • journaldutogo.com
  • jurnal.md
  • kaieteurnewsonline.com
  • kanivatonga.co.nz
  • kbc.co.ke
  • kentnews.online
  • kilkennypeople.ie
  • kiwikidsnews.co.nz
  • kuwaittimes.com
  • lacittadisalerno.it
  • la-croix.com
  • lahora.com.ec
  • lanacion.cl
  • lanation.dj
  • lankabusinessonline.com
  • laprensagrafica.com
  • latimes.com
  • latribune.fr
  • laweekly.com
  • lemonde.fr
  • liberoquotidiano.it
  • libertas.sm
  • libertatea.ro
  • limerickleader.ie
  • lusakavoice.com
  • macleans.ca
  • madagascar-tribune.com
  • majorcadailybulletin.com
  • mbl.is
  • meanwhileinireland.com
  • mediapart.fr
  • mediareform.org.uk
  • mercurynews.com
  • middleeastmonitor.com
  • minnpost.com
  • monde-diplomatique.fr
  • mwnation.com
  • naftemporiki.gr
  • naharnet.com
  • nationalobserver.com
  • navhindtimes.in
  • nbcchicago.com
  • nbcmiami.com
  • nbcwashington.com
  • necn.com
  • nepalitimes.com
  • neweurope.eu
  • news.lk
  • newsagencyblog.com.au
  • newsrust.com
  • notiziegeopolitiche.net
  • novamakedonija.com.mk
  • novilist.hr
  • novinite.com
  • ntv.ru
  • nv-online.info
  • nyasatimes.com
  • nytimes.com
  • oneindia.com
  • onlanka.com
  • orissapost.com
  • timeschronicle.ca
  • ouestribune-dz.com
  • owensoundsuntimes.com
  • ozodi.org
  • pakistantoday.com.pk
  • peachlandview.com
  • pembrokeobserver.com
  • perthnow.com.au
  • phillyvoice.com
  • phnompenhpost.com
  • thepinknews.com
  • politico.eu
  • politics.co.uk
  • popularmyanmar.com
  • positive.news
  • powersportz.tv
  • premiumtimesng.com
  • prensa-latina.cu
  • prensalibre.com
  • pressandjournal.co.uk
  • theworld.org
  • publimetro.com.mx
  • publishedreporter.com
  • radiohc.cu
  • radiondekeluka.org
  • rand.org
  • rappler.com
  • rawstory.com
  • razon.com.mx
  • reforma.com
  • repubblica.it
  • retailnews.asia
  • rfa.org
  • rfi.fr
  • rm.co.mz
  • rsvplive.ie
  • rtb.bf
  • rtrs.tv
  • rts.rs
  • rttlep.tl
  • saanichnews.com
  • sabcnews.com
  • saipantribune.com
  • salon.com
  • sbs.com.au
  • scmp.com
  • scoop.co.nz
  • scottishfield.co.uk
  • shetlandtimes.co.uk
  • sibconline.com.sb
  • sidwaya.info
  • sinceindependence.com
  • sn.at
  • solomonstarnews.com
  • euronews247.com
  • spiegel.de
  • sta.si
  • stluciamirroronline.com
  • capsula.sa
  • straight.com
  • stratfordbeaconherald.com
  • sudquotidien.sn
  • sundaypost.com
  • svd.se
  • tagesschau.de
  • tahitinews.co
  • techgenyz.com
  • telegraaf.nl
  • telegraph.co.uk
  • teluguglobal.com
  • tempo.com.ph
  • tentaran.com
  • the42.ie
  • theage.com.au
  • theargus.co.uk
  • theboltonnews.co.uk
  • thecourier.co.uk
  • thedailymash.co.uk
  • thedailyscrumnews.com
  • theflorentine.net
  • thefridaytimes.com
  • the-gazette.co.uk
  • theguardian.com
  • thejc.com
  • thejournal.ie
  • theleader.info
  • themontserratreporter.com
  • thenationalherald.com
  • thenews.mx
  • thenorthernecho.co.uk
  • thenorthlines.com
  • theolivepress.es
  • thepoke.com
  • thescarboroughnews.co.uk
  • theseasidegazette.com
  • thestkittsnevisobserver.com
  • thetimesofbengal.com
  • theyucatantimes.com
  • thisdaylive.com
  • times.co.nz
  • timpul.md
  • topky.sk
  • tvm.co.mz
  • twincities.com
  • utusan.com.my
  • vaticannews.va
  • vecernji.hr
  • vg.no
  • vicnews.com
  • vijesti.me
  • vikalpa.org
  • virakesari.lk
  • volksblatt.li
  • watchdoguganda.com
  • wort.lu
  • woxx.lu
  • wprost.pl
  • yabiladi.com
  • yahoo.com
  • yorkpress.co.uk
  • youtube.com
  • ziaruldeiasi.ro
  • zlv.lu
  • euobserver.com
  • znsbahamas.com
  • welt.de
  • focus.de
  • bild.de
  • wissenschaft.de
  • spektrum.de
  • forschung-und-wissen.de
  • reddit.com
  • kyivpost.com
  • theepochtimes.com
  • dailywire.com
  • thedispatch.com
  • reason.com
  • reuters.com
  • hurriyet.com.tr
  • yenisafak.com
  • internethaber.com
  • rferl.org
  • haaretz.com
  • sport.ua
  • isport.ua

Country Codes

Country Code (ISO 3166)
Afghanistan af
Albania al
Algeria dz
American Samoa as
Anguilla ai
Australia au
Austria at
Bahamas bs
Bahrain bh
Bangladesh bd
Barbados bb
Belarus by
Belgium be
Belize bz
Benin bj
Bermuda bm
Bhutan bt
Bosnia And Herzegovina ba
Bouvet Island bv
Brazil br
British Indian Ocean Territory io
Brunei Darussalam bn
Bulgaria bg
Burkina Faso bf
Burundi bi
Cambodia kh
Cameroon cm
Canada ca
Cape Verde cv
Central African Republic cf
Chile cl
China cn
Colombia co
Comoros km
Congo, Democratic Republic Of The cd
Congo, Republic Of The cg
Costa Rica cr
Cote D'ivoire ci
Croatia hr
Cuba cu
Cyprus cy
Czech Republic cz
Denmark dk
Djibouti dj
Dominican Republic do
Ecuador ec
Egypt eg
El Salvador sv
Eritrea er
Ethiopia et
Europe eu
Fiji fj
Finland fi
France fr
French Guiana gf
French Polynesia pf
Gambia gm
Germany de
Ghana gh
Greece gr
Guatemala gt
Guinea gn
Guyana gy
Honduras hn
Hong Kong hk
Hungary hu
Iceland is
India in
Indonesia id
Iran ir
Iraq iq
Ireland ie
Israel il
Italy it
Japan jp
Jordan jo
Kazakhstan kz
Kenya ke
Kuwait kw
Laos la
Latvia lv
Lebanon lb
Lesotho ls
Liberia lr
Liechtenstein li
Lithuania lt
Luxembourg lu
Macedonia mk
Madagascar mg
Malawi mw
Malaysia my
Maldives mv
Mali ml
Malta mt
Mauritania mr
Mauritius mu
Mexico mx
Micronesia, Federated States Of fm
Moldova md
Monaco mc
Montenegro me
Montserrat ms
Morocco ma
Myanmar mm
Namibia na
Nepal np
Netherlands nl
New Zealand nz
Niger ne
Nigeria ng
North Korea kp
Norway no
Oman om
Pakistan pk
Palestinian Territory ps
Paraguay py
Peru pe
Philippines ph
Poland pl
Portugal pt
Qatar qa
Romania ro
Russia ru
Rwanda rw
Saint Kitts And Nevis kn
Saint Vincent And The Grenadines vc
San Marino sm
Saudi Arabia sa
Senegal sn
Serbia rs
Seychelles sc
Sierra Leone sl
Singapore sg
Slovakia sk
Slovenia si
Solomon Islands sb
Somalia so
South Africa za
South Korea kr
Spain es
Sri Lanka lk
Suriname sr
Swaziland sz
Sweden se
Switzerland ch
Syria sy
Taiwan tw
Tajikistan tj
Thailand th
Timor-leste tl
Togo tg
Tonga to
Trinidad And Tobago tt
Turkey tr
Tuvalu tv
Ukraine ua
Uganda ug
United Arab Emirates ae
United Kingdom gb
United States Of America us
Uruguay uy
Uzbekistan uz
Vanuatu vu
Zambia zm

Rate Limiting & Quotas

Each API plan comes with a daily quota of points. Every API call you make costs a certain amount of points. Usually, every request is
1 point
and
0.01 points
per result returned, but there are many exceptions. At the bottom of each endpoint description you will find information about the number of points required for that endpoint.

When you are on the free plan and your daily quota is used up, the API will respond with the error code 402 and no more calls can be made until your quota resets.

You have complete control over your quota by looking at your console dashboard and checking the API response headers that appear with every answer from the API. These response headers are:

  • X-API-Quota-Request: The number of points used by the request.
  • X-API-Quota-Used: The number of points used in total today. This number resets to zero at midnight UTC (click here to compare to your local time zone).
  • X-API-Quota-Left: The number of points left today (depends on your plan).

Rate Limiting

There is a limit of how many requests you can make per second. The limits depend on the plan you are on. If you try making more requests you will receive a 429 error.

  • Free: 60 requests in 1 minute
  • Reporter: 2 requests per second
  • Journalist: 10 requests per second
  • Editor: 20 requests per second

Authentication

To use the API you need an API key. You can get a free one by simply signing up here.

Once you have your API key, you have to put it in the request URL for every request you make like so ?api-key=YOUR-API-KEY.

Attention: Only the first query parameter is prefixed with a ? (question mark), all subsequent ones will be prefixed with a & (ampersand). That is how URLs work and nothing related to our API. Here's a full example with two parameters api-key and text: https://api.worldnewsapi.com/search-news?api-key=YOUR-API-KEY&text=tesla.

Alternatively, you can put the API key in the request header as x-api-key.

Tutorial on how to get started with the News API

World News API is an API that gives you access to thousands of news sources in over 50 languages from over 150 countries. The News accessed through the API is semantically tagged, allowing for semantic news search, where features like location extraction, organization extraction, person extraction, news author extraction, and semantic search is also available. This article will look at how you can get the World News API up and running.

Create an Account

To start, visit the World News API website and create an account. Once an account is created, confirming the email address is the next step. This is an important step, as you won't be able to access the API until you've confirmed your email. Simply click on the confirmation link to confirm that your email.

Getting the API Key

Now that your email is verified. Log in to your World News API account and obtain your API key. API key is a unique identifier that allows you to access the API and request news articles.

After you have successfully logged in, perform the following steps to obtain your API.



From your dashboard, click on "Profile". In the "Profile" section, click on "Show/Hide API Key" to show your API key.

Copy the API Key and save it somewhere safer for easier access. Don’t share it with anyone else!

Installing the SDK

After getting the API, the next step would be downloading and installing the SDK.

Download the SDK from the World News API website by navigating to the SDKs page. For this tutorial, we will be using Python.

Extract the downloaded SDK file to a folder on your computer to a suitable location.

Open Command Prompt in administrator mode by right-clicking on the Command Prompt icon and selecting "Run as administrator".

Navigate to the SDK directory using the "cd" command in Command Prompt (cd path/to/sdk_folder).

Execute the following command to install the openapi_client.

python setup.py install


After the installation process is complete, you are all good to go!

ModuleNotFoundError: No module named 'com'

Now an error that may occur (rarely) later on saying that a module is missing. Let’s see how we can fix that in case we encounter it when we try to fetch news using the API.

The error may look like as follows:

The fix for this problem is relatively simple, simple follow the steps mentioned below:

  1. Open the SDK folder which you extracted.
  2. Navigate to the directory named "openapi_client".
  3. Find a folder named "com" in the directory.
  4. Copy the folder named "com".
  5. Paste it in the directory where you are executing your query from (i.e. in the same folder from where you are executing the news query). And that's it! The error will be gone now.

Making Your first Request

Now that the "openapi_client" and "worldnewsapi" has been successfully installed, let’s test it out to see if we can successfully fetch some news.

Let's go through the code step by step to see what is really happening.

import openapi_client
from pprint import pprint
from com.worldnewsapi import news_api

In the snippet above, we are importing the necessary libraries.

  1. openapi_client - Base library for communication with servers.
  2. pprint - For pretting printing.
  3. com.worldnewsapi - Our API for fetching news.
configuration = openapi_client.Configuration(
    host = "https://api.worldnewsapi.com"
)

In the snippet above, we are setting the host for the openapi client to communicate with. In case the host is not provided, it will default to "https://api.worldnewsapi.com".

configuration.api_key['apiKey'] = "your_api_key"

To ensure that we can properly get authenticated with the server and communicate, we need to set an API key. As explained at the start of this article, you can get an API key after logging into your account.

with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = news_api.NewsApi(api_client)
url = "https://www.bbc.com/news/world-us-canada-59340789" # str | The url of the news.
analyze = True # bool | Whether to analyze the news (extract entities etc.) (default to False)

try:
    # Extract News
    api_response = api_instance.extract_news(url, analyze)
    pprint(api_response)
except openapi_client.ApiException as e:
    print("Exception when calling NewsApi->extract_news: %s\n" % e)

The above snippet is where most of the heavy lifting is done, the following operations are performed here:

  1. A context with an instance of API client is created.
  2. Instance of API class is created.
  3. Url of a news article is provided.
  4. To extract entities and perform additional analysis, "analyze" is set to true.
  5. Finally, the news is extracted using the "extract_news" method.

Calling "extract_news" consumes 1 point, if "analyze" is set to be true, 2 additional points are consumed. In the demonstrated example, a total of 3 points (1 for extract news, 2 for setting analyze to true) will be consumed. More on points later on.

Once executed, you will get output as follows:



Since the reply is in JSON format, it is easy to filter data, useful especially when skimming through the data.

api_response = api_instance.extract_news(url, analyze)
pprint("Title: " + api_response['title'])
pprint("Author: " + api_response['author'])
pprint("Url: " + api_response['url'])
pprint("Text: " + api_response['text'])

Which would give the output as:


Full Code

Putting it all together, the final code is as follows:

import openapi_client
from pprint import pprint
from com.worldnewsapi import news_api


# Defining the host is optional and defaults to https://api.worldnewsapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
    host = "https://api.worldnewsapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKey
configuration.api_key['apiKey'] = 'your_api_key'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = news_api.NewsApi(api_client)
    url = "https://www.bbc.com/news/world-us-canada-59340789" # str | The url of the news.
    analyze = True # bool | Whether to analyze the news (extract entities etc.) (default to False)

    try:
        # Extract News
        api_response = api_instance.extract_news(url, analyze)
        pprint(api_response)
    except openapi_client.ApiException as e:
        print("Exception when calling NewsApi->extract_news: %s\n" % e)

World News API provides a very accessible and convenient way to news from all over the world. It provides you with news from more than 50 languages from 150+ countries. One of the best things about the API is that it is semantically tagged - meaning you can filter news based on sentiment and find the exact set of news you are looking for. Easily, Efficiently and Effortlessly.

Happy coding.