{"id":1932,"date":"2023-08-31T11:37:19","date_gmt":"2023-08-31T06:07:19","guid":{"rendered":"https:\/\/newsdata.io\/blog\/?p=1932"},"modified":"2024-09-16T17:00:18","modified_gmt":"2024-09-16T11:30:18","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;1933&#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 to your program.<\/h4>\n<p><code>from newsdataapi import NewsDataApiClient\u2019<\/code><\/li>\n<\/ul>\n<p>Now, NewsData.io offers 4 endpoints i.e. <strong>crypto news<\/strong>, <strong>latest news<\/strong>, <strong>news sources<\/strong>, and <strong>news archive<\/strong> <strong>API<\/strong>. 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 mentioned steps 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.news_api()<\/code><code>print(response) print data<\/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 of which will be:<\/p>\n<p><code>response = api.news_api(q=pizza)<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2004 size-large\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-04-1.png?resize=1024%2C323&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"323\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-04-1.png?resize=1024%2C323&amp;ssl=1 1024w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-04-1.png?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-04-1.png?resize=768%2C242&amp;ssl=1 768w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-04-1.png?w=1031&amp;ssl=1 1031w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" data-recalc-dims=\"1\" \/><\/p>\n<p>This will fetch all the articles related to pizza from <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>To <strong>scroll<\/strong> through all the latest news extracted by news API:<\/p>\n<p><code>response = api.news_api(q=&#039;pizza&#039;,page=&#039;nextPage_value&#039;,scroll=True) print(response)<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2005 size-full\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-17-1.png?resize=1017%2C346&#038;ssl=1\" alt=\"\" width=\"1017\" height=\"346\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-17-1.png?w=1017&amp;ssl=1 1017w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-17-1.png?resize=300%2C102&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-17-1.png?resize=768%2C261&amp;ssl=1 768w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" data-recalc-dims=\"1\" \/><\/p>\n<p>The \u2018<strong>max_result<\/strong>\u2019 parameter can be used if you don\u2019t have enough API credits.<\/p>\n<p><code>response = api.news_api(q=&#039;pizza&#039;,page=&#039;nextPage_value&#039;,scroll=True,max_result=1000) print(response)<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1926 size-large\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-24-e1693918567258-1024x331.png?resize=1024%2C331&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"331\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-24-e1693918567258.png?resize=1024%2C331&amp;ssl=1 1024w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-24-e1693918567258.png?resize=300%2C97&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-24-e1693918567258.png?resize=768%2C249&amp;ssl=1 768w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-29-15-26-24-e1693918567258.png?w=1041&amp;ssl=1 1041w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" data-recalc-dims=\"1\" \/><br \/>\nThis parameter will fetch you <strong>1000 articles<\/strong> from available articles.[\/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<p><code>api = NewsDataApiClient(apikey=&#039;YOUR_API_KEY&#039;)<\/code><\/p>\n<p><code>response = api.crypto_api(q=&#039;bitcoin&#039;)<\/code><\/p>\n<p><code>print(response)<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2006 size-full\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-21-1.png?resize=1010%2C338&#038;ssl=1\" alt=\"\" width=\"1010\" height=\"338\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-21-1.png?w=1010&amp;ssl=1 1010w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-21-1.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-21-1.png?resize=768%2C257&amp;ssl=1 768w\" sizes=\"(max-width: 1010px) 100vw, 1010px\" data-recalc-dims=\"1\" \/><\/p>\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 <strong>up to 2 years<\/strong> as per the <a href=\"https:\/\/newsdata.io\/pricing\">subscription plan<\/a>. Access 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<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2009 size-large\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-53-44-1.png?resize=1024%2C261&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"261\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-53-44-1.png?resize=1024%2C261&amp;ssl=1 1024w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-53-44-1.png?resize=300%2C77&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-53-44-1.png?resize=768%2C196&amp;ssl=1 768w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-53-44-1.png?w=1392&amp;ssl=1 1392w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" data-recalc-dims=\"1\" \/><\/p>\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 <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_1726483050386{padding-bottom: 20px !important;}&#8221;]To get a list of <strong>100 random sources<\/strong> of Newsdata.io News API use:<\/p>\n<p><code>api = NewsDataApiClient(apikey=&quot;YOUR_API_KEY&quot;)<\/code><\/p>\n<p><code>response = api.sources_api<\/code><\/p>\n<p><code>print(response)<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2012 size-large\" src=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-02-1.png?resize=1024%2C290&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"290\" srcset=\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-02-1.png?resize=1024%2C290&amp;ssl=1 1024w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-02-1.png?resize=300%2C85&amp;ssl=1 300w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-02-1.png?resize=768%2C218&amp;ssl=1 768w, https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-31-10-55-02-1.png?w=1206&amp;ssl=1 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" data-recalc-dims=\"1\" \/><\/p>\n<p>The given request will fetch a list of 100 random news sources.[\/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][image_with_animation image_url=&#8221;3027&#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":14,"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=\"2024-09-16T11:30:18+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=\"Prabhleen Kaur\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prabhleen Kaur\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 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\":\"2024-09-16T11:30:18+00:00\",\"author\":{\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/24759f2a710e24a49089f8cf2b8e70b3\"},\"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\/24759f2a710e24a49089f8cf2b8e70b3\",\"name\":\"Prabhleen Kaur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/17fb948d4989270bb762d1379a5e874f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/17fb948d4989270bb762d1379a5e874f?s=96&d=mm&r=g\",\"caption\":\"Prabhleen Kaur\"},\"description\":\"Hello, Curious Minds! Welcome to my corner of the digital world, a space brimming with words and woven with ideas. Fresh out of the rigorous trenches of an Economics honors degree at the esteemed University of Delhi, I know a thing or two about crunching numbers and dissecting trends. But beyond the world of graphs and equations, lies my love for reading and writing. Admittedly, I'm a newbie in the content writing scene, still tasting the ink of fresh beginnings. I believe every corner of life holds a story waiting to be told, and I'm eager to be your storyteller. So, strap yourselves in, dear readers, and let's dive into the captivating world of words together! P.S. Feel free to drop a comment or reach out \u2013 I'm always up for a good conversation!\",\"sameAs\":[\"https:\/\/www.instagram.com\/whatnowprabhleen\/\",\"www.linkedin.com\/in\/prabhleen-kaur-8b8823202\"],\"url\":\"https:\/\/newsdata.io\/blog\/author\/prabhleen\/\"}]}<\/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":"2024-09-16T11:30:18+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":"Prabhleen Kaur","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prabhleen Kaur","Est. reading time":"5 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":"2024-09-16T11:30:18+00:00","author":{"@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/24759f2a710e24a49089f8cf2b8e70b3"},"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\/24759f2a710e24a49089f8cf2b8e70b3","name":"Prabhleen Kaur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/17fb948d4989270bb762d1379a5e874f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/17fb948d4989270bb762d1379a5e874f?s=96&d=mm&r=g","caption":"Prabhleen Kaur"},"description":"Hello, Curious Minds! Welcome to my corner of the digital world, a space brimming with words and woven with ideas. Fresh out of the rigorous trenches of an Economics honors degree at the esteemed University of Delhi, I know a thing or two about crunching numbers and dissecting trends. But beyond the world of graphs and equations, lies my love for reading and writing. Admittedly, I'm a newbie in the content writing scene, still tasting the ink of fresh beginnings. I believe every corner of life holds a story waiting to be told, and I'm eager to be your storyteller. So, strap yourselves in, dear readers, and let's dive into the captivating world of words together! P.S. Feel free to drop a comment or reach out \u2013 I'm always up for a good conversation!","sameAs":["https:\/\/www.instagram.com\/whatnowprabhleen\/","www.linkedin.com\/in\/prabhleen-kaur-8b8823202"],"url":"https:\/\/newsdata.io\/blog\/author\/prabhleen\/"}]}},"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\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/comments?post=1932"}],"version-history":[{"count":8,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/1932\/revisions"}],"predecessor-version":[{"id":7908,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/1932\/revisions\/7908"}],"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}]}}