{"id":1932,"date":"2023-08-31T11:37:19","date_gmt":"2023-08-31T06:07:19","guid":{"rendered":"https:\/\/newsdata.io\/blog\/?p=1932"},"modified":"2025-12-12T17:41:29","modified_gmt":"2025-12-12T12:11:29","slug":"news-api-python-client","status":"publish","type":"post","link":"https:\/\/newsdata.io\/blog\/news-api-python-client\/","title":{"rendered":"How to use news API in Python: Newsdata.io"},"content":{"rendered":"[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overflow=&#8221;visible&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; bottom_margin=&#8221;220&#8243; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; sticky_content=&#8221;true&#8221; sticky_content_functionality=&#8221;js&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/4&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221; column_padding_type=&#8221;default&#8221; gradient_type=&#8221;default&#8221; offset=&#8221;vc_hidden-sm vc_hidden-xs&#8221;][\/vc_column][vc_column right_padding_desktop=&#8221;40&#8243; right_padding_tablet=&#8221;0&#8243; right_padding_phone=&#8221;0&#8243; top_margin=&#8221;-240&#8243; top_margin_tablet=&#8221;-180&#8243; top_margin_phone=&#8221;-135&#8243; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; el_class=&#8221;text_block_wrapper&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;3\/4&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221; column_padding_type=&#8221;advanced&#8221; gradient_type=&#8221;default&#8221; offset=&#8221;vc_col-lg-9 vc_col-md-12&#8243;][image_with_animation image_url=&#8221;6074&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;zoom&#8221; alignment=&#8221;&#8221; border_radius=&#8221;10px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text css=&#8221;.vc_custom_1707741963666{padding-bottom: 20px !important;}&#8221;]In this article, we\u2019ll dive into the details of the \u201cPython Client\u201d integration guide.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1707741951265{padding-bottom: 20px !important;}&#8221;]\n<h2><b>Python Client<\/b><\/h2>\n<p>With the \u201cClient Python\u201d section of the NewsData.io documentation, you can effortlessly integrate the API into your Python applications, whether you\u2019re building news aggregators, data analysis tools, or research platforms.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1726482015887{padding-bottom: 20px !important;}&#8221;]\n<h3><b>Initial Steps of Integration News API in Python<br \/>\n<\/b><\/h3>\n<ul>\n<li>\n<h4>Obtain API Key<\/h4>\n<p>The first step is obtaining your unique API key by registering for an account. This serves as the authentication token for your requests.<\/li>\n<\/ul>\n<ul>\n<li>\n<h4>Install newsdataapi<\/h4>\n<p>Start by installing the \u201cnewsdataapi\u201d library using the given pip command:<br \/>\n<code>pip install newsdataapi<\/code><\/li>\n<\/ul>\n<ul>\n<li>\n<h4>Import the \u2018NewsDataApiClient\u2019 package into your program.<\/h4>\n<p><code>from newsdataapi import NewsDataApiClient<\/code><\/li>\n<\/ul>\n<p>Now, NewsData.io offers 4 endpoints, i.e., crypto_api, news_api, latest_api, and archive_api. Let\u2019s understand the different request parameters of each endpoint.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1716871849301{padding-bottom: 20px !important;}&#8221;]\n<h2><b>1. &#8216;Latest&#8217; News Endpoint<\/b><\/h2>\n[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1726482822617{padding-bottom: 20px !important;}&#8221;]&#8217;<strong>Latest<\/strong>&#8216; News endpoint allows users to get the top live breaking news of the past 48 hours from all over the world. To fetch the Latest news, follow the steps mentioned below.<\/p>\n<p>After the initial integration, the latest news parameter would be:<\/p>\n<ul>\n<li>\u2018For API key authorization, initialize the client with your API key<br \/>\n<code>api = NewsDataApiClient(apikey=\u2019YOUR_API_KEY\u2019)<\/code><\/li>\n<\/ul>\n<ul>\n<li>Data can now be fetched:<br \/>\n<code>response = api.latest_api()<br \/>\nprint(response)<\/code><\/li>\n<\/ul>\n<p>The &#8216;latest&#8217; news endpoint accepts queries and other supported parameters in brackets (). Enter the information you want to retrieve data about within these brackets.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1726482947221{padding-bottom: 20px !important;}&#8221;]\n<h3><strong>Let&#8217;s understand with the help of an example.<\/strong><\/h3>\n<p>If you want to fetch data on <strong>Pizza<\/strong>, then <strong>q=pizza<\/strong>. The request parameter will be:<\/p>\n<p><code>response = api.latest_api(q=pizza)<\/code><\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.latest_api(q=&#039;pizza&#039;)\nprint(response)<\/code><\/pre>\n<p>This will fetch all the articles related to pizza from the <strong>past 48 hours<\/strong>. And to navigate to the next page, you need to use the <strong><a href=\"https:\/\/newsdata.io\/blog\/newsdata-pagination\/\">nextPage<\/a> parameter<\/strong>.<\/p>\n<p>You can use the <strong>scroll<\/strong> parameter to fetch less amount of data. To <strong>scroll<\/strong> through all the latest news extracted by the news API:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.latest_api(q=&#039;pizza&#039;,scroll=True,max_result=1000)\nprint(response)<\/code><\/pre>\n<p>The \u2018<strong>max_result<\/strong>\u2019 parameter is used with the<strong> scroll<\/strong> parameter to set the limit of results according to your requirements.<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponses = api.latest_api(q=&#039;pizza&#039;,paginate=True,max_pages=10)\nfor response in responses:\n    print(response)<\/code><\/pre>\n<p>This parameter will fetch you <strong>1000 articles<\/strong> from the available articles.[\/vc_column_text][vc_column_text]<span style=\"font-weight: 400\">If you want to fetch a large amount of data, you can use the<strong> paginate<\/strong> parameter. It provides you with results\u2014pages with large amounts of data.\u00a0<\/span><\/p>\n<p><code>response = api.latest_api(q=pizza,paginate=true) <\/code><\/p>\n<p><code>print(response)<\/code><\/p>\n<p>The <strong>&#8220;Max_pages&#8221;<\/strong> parameter is used with the <strong>paginate<\/strong> parameter to limit the number of page results according to the requirement.<\/p>\n<p><code>response = api.latest_api(q=pizza,paginate=true,max_pages=5) <\/code><\/p>\n<p><code>print(response)<\/code>[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1707741372140{padding-bottom: 20px !important;}&#8221;]\n<h2><b>2. \u2018Crypto\u2019 News Endpoint<\/b><\/h2>\n[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1726482963527{padding-bottom: 20px !important;}&#8221;]&#8217;<strong>Crypto<\/strong>&#8216; news endpoint allows users to fetch all the news articles related to cryptocurrency.<br \/>\nThe query here is &#8216;<strong>Bitcoin<\/strong>&#8216; such that the request parameter for crypto news API is:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.crypto_api(q=&#039;bitcoin&#039;)\nprint(response)<\/code><\/pre>\n<p>The &#8216;<strong>crypto<\/strong>&#8216; endpoint accepts queries and other supported parameters in brackets (). Enter the information you want to retrieve data about within these brackets.<\/p>\n<p>The \u2018<strong>scroll=True<\/strong>\u2019 and \u2018<strong>max_result<\/strong>\u2019 parameters can also be used to help fetch data.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1707741259482{padding-bottom: 20px !important;}&#8221;]\n<h2><b>3. News \u2018Archive\u2019 Endpoint<\/b><\/h2>\n[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1726483024026{padding-bottom: 20px !important;}&#8221;]News &#8216;<strong>Archive<\/strong>&#8216; endpoint allows paid users to access <strong>historical news<\/strong> for up to<strong> 2 to 5 years,<\/strong> as per the <a href=\"https:\/\/newsdata.io\/pricing\">subscription plans.<\/a>\u00a0Access to older news can be further provided by contacting the website.<br \/>\nThe query here is assumed to be pizza, such that the request parameter is:<\/p>\n<p><code>api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)<\/code><\/p>\n<p><code>response = api.archive_api(q=&#039;pizza&#039;,from_date=&#039;2021-01-01&#039;,to_date=&#039;2021-06-06&#039;)<\/code><\/p>\n<p><code>print(response)<\/code><\/p>\n<p>The given query will fetch you all the articles on pizza from January 1st, 2021, to June 6th,2021.<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.archive_api(q=&#039;pizza&#039;,from_date=&#039;2025-01-01&#039;,to_date=&#039;2025-06-15&#039;)\nprint(response)<\/code><\/pre>\n<p>The &#8216;<strong>archive<\/strong>&#8216; endpoint accepts queries and other supported parameters in brackets (). Enter the information you want to retrieve data about within these brackets.<\/p>\n<p>The \u2018<strong>scroll=True<\/strong>\u2019 and \u2018<strong>max_result<\/strong>\u2019 parameters can also be used to help fetch data.<br \/>\nYou can add categories, languages, and countries as well. Check out the <a href=\"https:\/\/newsdata.io\/documentation\/#latest-news\">documentation<\/a> to learn more about it.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1709018619434{padding-bottom: 20px !important;}&#8221;]\n<h2><b>4. News \u2018Sources\u2019 Endpoint<\/b><\/h2>\n[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1709018619434{padding-bottom: 20px !important;}&#8221;]To get a list of <strong>100 random sources<\/strong> of Newsdata.io News API use:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.sources_api(language=&#039;en&#039;)\nprint(response)<\/code><\/pre>\n<p>The given request will fetch a list of 100 random news sources.[\/vc_column_text][vc_column_text]\n<h2><strong>5. Market News Endpoint<\/strong><\/h2>\n<p>The Market News endpoint provides access to the latest and most relevant financial news, stock market news, and business-related news.<\/p>\n<p>The query here is &#8216;AAPL&#8217;, such that the request parameter for the Market News API is:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.market_api(q=&#039;AAPL&#039;)\nprint(response)<\/code><\/pre>\n[\/vc_column_text][vc_column_text]\n<h2><b>6. News Count<\/b><\/h2>\n[\/vc_column_text][vc_column_text]The Count Endpoint allows you to get the exact number of news articles on a daily and hourly basis available in the NewsData.io database that match your query filters, without fetching the actual articles.<\/p>\n<p>The example for the count news endpoint will be such as:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.count_api(q=&#039;pizza&#039;,from_date=&#039;2025-01-01&#039;,to_date=&#039;2025-06-15&#039;)\nprint(response)<\/code><\/pre>\n[\/vc_column_text][vc_column_text]Example code for Crypto Count News Endpoint will be such as:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.crypto_count_api(q=&#039;bitcoin&#039;,from_date=&#039;2025-06-01&#039;,to_date=&#039;2025-11-15&#039;)\nprint(response)<\/code><\/pre>\n[\/vc_column_text][vc_column_text]The example for the Market Count Endpoint will be such as:<\/p>\n<pre><code class=\"language-python\">api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)\nresponse = api.market_count_api(q=&#039;AAPL&#039;,from_date=&#039;2025-06-01&#039;,to_date=&#039;2025-11-15&#039;)\nprint(response)<\/code><\/pre>\n[\/vc_column_text][vc_column_text]<strong>Note:<\/strong>\u00a0 The parameters discussed above can be used for all the news endpoints except news sources in the Python client.[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1709018745335{padding-bottom: 20px !important;}&#8221;]\n<h2><strong>Frequently Asked Questions<\/strong><\/h2>\n[\/vc_column_text][vc_column_text css=&#8221;.vc_custom_1709031098834{padding-bottom: 20px !important;}&#8221;]\n<h3><strong>Q1. How to access news API in Python?<\/strong><\/h3>\n<p>To access news API in Python first you need to get an API key from your provider. Once done, you need to send HTTP requests to your API endpoints with the required parameters and headers to get the news data programmatically. For detailed information visit the <a href=\"https:\/\/newsdata.io\/documentation\/#client_py\">Python client library<\/a>.<\/p>\n<h3><strong>Q2. Can I filter news articles using the Python client?<\/strong><\/h3>\n<p>Yes, you can filter news articles using the Python client. You can filter the articles by either <strong>filtering using a keyword<\/strong> or by <strong>filtering using tags<\/strong>.<\/p>\n<h3><strong>Q3. Does the Newsdata.io News API support real-time news updates?<\/strong><\/h3>\n<p>Yes, Newsdata.io News API provide real-time news updates. This means you can retrieve news articles as soon as they are published by various news sources.<br \/>\n[\/vc_column_text][vc_column_text]I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.[\/vc_column_text][image_with_animation image_url=&#8221;5722&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;none&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221; img_link=&#8221;https:\/\/bit.ly\/41MjLOC&#8221;][\/vc_column][\/vc_row]\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Understanding how to integrate News API with Python Client.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":17,"featured_media":6074,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[46],"tags":[3,143],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use news API in Python: Newsdata.io - NewsData.io<\/title>\n<meta name=\"description\" content=\"Learn how to integrate NewsData.io News API with Python using the &quot;Client Python&quot; integration. Explore codes for utilizing News API Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/newsdata.io\/blog\/news-api-python-client\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use news API in Python: Newsdata.io - NewsData.io\" \/>\n<meta property=\"og:description\" content=\"Learn how to integrate NewsData.io News API with Python using the &quot;Client Python&quot; integration. Explore codes for utilizing News API Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/newsdata.io\/blog\/news-api-python-client\/\" \/>\n<meta property=\"og:site_name\" content=\"Newsdata.io - Stay Updated with the Latest News API Trends\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-31T06:07:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-12T12:11:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1499\" \/>\n\t<meta property=\"og:image:height\" content=\"840\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aditi Chaudhary\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AditiCh17996036\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aditi Chaudhary\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/\",\"url\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/\",\"name\":\"How to use news API in Python: Newsdata.io - NewsData.io\",\"isPartOf\":{\"@id\":\"https:\/\/newsdata.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1\",\"datePublished\":\"2023-08-31T06:07:19+00:00\",\"dateModified\":\"2025-12-12T12:11:29+00:00\",\"author\":{\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/531c7aac51910b5277dd51422cf0d964\"},\"description\":\"Learn how to integrate NewsData.io News API with Python using the \\\"Client Python\\\" integration. Explore codes for utilizing News API Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/newsdata.io\/blog\/news-api-python-client\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1\",\"width\":1499,\"height\":840,\"caption\":\"how to use news API IN python client\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/newsdata.io\/blog\/news-api-python-client\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/newsdata.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use news API in Python: Newsdata.io\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/newsdata.io\/blog\/#website\",\"url\":\"https:\/\/newsdata.io\/blog\/\",\"name\":\"Newsdata.io - Stay Updated with the Latest News API Trends\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/newsdata.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/531c7aac51910b5277dd51422cf0d964\",\"name\":\"Aditi Chaudhary\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/331be6db4c207ba712e439ded52d96d1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/331be6db4c207ba712e439ded52d96d1?s=96&d=mm&r=g\",\"caption\":\"Aditi Chaudhary\"},\"description\":\"Aditi Chaudhary is an enthusiastic content writer at Newsdata.io, where she covers topics related to real-time news, News APIs, data-driven journalism, and emerging trends in media and technology. Aditi is passionate about storytelling, research, and creating content that informs and inspires. As a student of Journalism and Mass Communication with a strong interest in the evolving landscape of digital media, she aims to merge her creativity with credibility to expand her knowledge and bring innovation into every piece she creates.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/aditi-chaudhary-456076293\/\",\"https:\/\/x.com\/AditiCh17996036\"],\"url\":\"https:\/\/newsdata.io\/blog\/author\/aditi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use news API in Python: Newsdata.io - NewsData.io","description":"Learn how to integrate NewsData.io News API with Python using the \"Client Python\" integration. Explore codes for utilizing News API Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/newsdata.io\/blog\/news-api-python-client\/","og_locale":"en_US","og_type":"article","og_title":"How to use news API in Python: Newsdata.io - NewsData.io","og_description":"Learn how to integrate NewsData.io News API with Python using the \"Client Python\" integration. Explore codes for utilizing News API Python.","og_url":"https:\/\/newsdata.io\/blog\/news-api-python-client\/","og_site_name":"Newsdata.io - Stay Updated with the Latest News API Trends","article_published_time":"2023-08-31T06:07:19+00:00","article_modified_time":"2025-12-12T12:11:29+00:00","og_image":[{"width":1499,"height":840,"url":"https:\/\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png","type":"image\/png"}],"author":"Aditi Chaudhary","twitter_card":"summary_large_image","twitter_creator":"@AditiCh17996036","twitter_misc":{"Written by":"Aditi Chaudhary","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/","url":"https:\/\/newsdata.io\/blog\/news-api-python-client\/","name":"How to use news API in Python: Newsdata.io - NewsData.io","isPartOf":{"@id":"https:\/\/newsdata.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage"},"image":{"@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1","datePublished":"2023-08-31T06:07:19+00:00","dateModified":"2025-12-12T12:11:29+00:00","author":{"@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/531c7aac51910b5277dd51422cf0d964"},"description":"Learn how to integrate NewsData.io News API with Python using the \"Client Python\" integration. Explore codes for utilizing News API Python.","breadcrumb":{"@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/newsdata.io\/blog\/news-api-python-client\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/#primaryimage","url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1","contentUrl":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1","width":1499,"height":840,"caption":"how to use news API IN python client"},{"@type":"BreadcrumbList","@id":"https:\/\/newsdata.io\/blog\/news-api-python-client\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/newsdata.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use news API in Python: Newsdata.io"}]},{"@type":"WebSite","@id":"https:\/\/newsdata.io\/blog\/#website","url":"https:\/\/newsdata.io\/blog\/","name":"Newsdata.io - Stay Updated with the Latest News API Trends","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/newsdata.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/531c7aac51910b5277dd51422cf0d964","name":"Aditi Chaudhary","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/331be6db4c207ba712e439ded52d96d1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/331be6db4c207ba712e439ded52d96d1?s=96&d=mm&r=g","caption":"Aditi Chaudhary"},"description":"Aditi Chaudhary is an enthusiastic content writer at Newsdata.io, where she covers topics related to real-time news, News APIs, data-driven journalism, and emerging trends in media and technology. Aditi is passionate about storytelling, research, and creating content that informs and inspires. As a student of Journalism and Mass Communication with a strong interest in the evolving landscape of digital media, she aims to merge her creativity with credibility to expand her knowledge and bring innovation into every piece she creates.","sameAs":["https:\/\/www.linkedin.com\/in\/aditi-chaudhary-456076293\/","https:\/\/x.com\/AditiCh17996036"],"url":"https:\/\/newsdata.io\/blog\/author\/aditi\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1","category":["Documentation"],"featured_image_url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/review-blog-5.png?fit=1499%2C840&ssl=1","_links":{"self":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/1932"}],"collection":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/comments?post=1932"}],"version-history":[{"count":6,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/1932\/revisions"}],"predecessor-version":[{"id":6595,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/1932\/revisions\/6595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/media\/6074"}],"wp:attachment":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/media?parent=1932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/categories?post=1932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/tags?post=1932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}