Package: newscatcherapi-python-sdk
newscatcherapi-python-sdkVisit our websitehttps://newscatcherapi.comTable of ContentsRequirementsInstallingGetting StartedAsyncRaw HTTP ResponseReferencenewscatcher.authors.getnewscatcher.authors.postnewscatcher.latest_headlines.getnewscatcher.latest_headlines.postnewscatcher.search.getnewscatcher.search.postnewscatcher.search_similar.getnewscatcher.search_similar.postnewscatcher.sources.getnewscatcher.sources.postnewscatcher.subscription.getnewscatcher.subscription.postRequirementsPython >=3.7Installingpipinstallnewscatcherapi-python-sdk==6.0.1Getting Startedfrompprintimportpprintfromnewscatcherapi_clientimportNewscatcher,ApiExceptionnewscatcher=Newscatcher(api_key="YOUR_API_KEY",)try:# [Get] Search By Author Requestget_response=newscatcher.authors.get(author_name="author_name_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)print(get_response)exceptApiExceptionase:print("Exception when calling AuthorsApi.get:%s\n"%e)pprint(e.body)ife.status==422:pprint(e.body["detail"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Asyncasyncsupport is available by prependingato any method.importasynciofrompprintimportpprintfromnewscatcherapi_clientimportNewscatcher,ApiExceptionnewscatcher=Newscatcher(api_key="YOUR_API_KEY",)asyncdefmain():try:# [Get] Search By Author Requestget_response=awaitnewscatcher.authors.aget(author_name="author_name_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)print(get_response)exceptApiExceptionase:print("Exception when calling AuthorsApi.get:%s\n"%e)pprint(e.body)ife.status==422:pprint(e.body["detail"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)asyncio.run(main())Raw HTTP ResponseTo access raw HTTP response values, use the.rawnamespace.frompprintimportpprintfromnewscatcherapi_clientimportNewscatcher,ApiExceptionnewscatcher=Newscatcher(api_key="YOUR_API_KEY",)try:# [Get] Search By Author Requestget_response=newscatcher.authors.raw.get(author_name="author_name_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)pprint(get_response.body)pprint(get_response.headers)pprint(get_response.status)pprint(get_response.round_trip_time)exceptApiExceptionase:print("Exception when calling AuthorsApi.get:%s\n"%e)pprint(e.body)ife.status==422:pprint(e.body["detail"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Referencenewscatcher.authors.getThis endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more.🛠️ Usageget_response=newscatcher.authors.get(author_name="author_name_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersauthor_name:strsources:strpredefined_sources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]published_date_precision:strby_parse_date:boolsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intinclude_nlp_data:boolhas_nlp:booltheme:strner_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]🔄 ReturnAuthorsGetResponse🌐 Endpoint/api/authorsget🔙Back to Table of Contentsnewscatcher.authors.postThis endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more.🛠️ Usagepost_response=newscatcher.authors.post(author_name="string_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersauthor_name:strsources:strpredefined_sources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]published_date_precision:strby_parse_date:boolsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intinclude_nlp_data:boolhas_nlp:booltheme:strner_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]⚙️ Request BodyAuthorSearchRequest🔄 ReturnAuthorsPostResponse🌐 Endpoint/api/authorspost🔙Back to Table of Contentsnewscatcher.latest_headlines.getThis endpoint allows you to get latest headlines. You need to specify since when you want to get the latest headlines. You can also filter by language, country, source, and more.🛠️ Usageget_response=newscatcher.latest_headlines.get(when="7d",by_parse_date=False,lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",ranked_only="string_example",is_headline=True,is_paid_content=True,parent_url="string_example",theme="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,clustering_enabled=True,clustering_threshold=3.14,clustering_variable="string_example",include_nlp_data=True,has_nlp=True,org_entity_name="string_example",per_entity_name="string_example",loc_entity_name="string_example",misc_entity_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parameterswhen:strby_parse_date:boollang:strnot_lang:strcountries:strnot_countries:strsources:strpredefined_sources:strnot_sources:strranked_only:stris_headline:boolis_paid_content:boolparent_url:strtheme:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intclustering_enabled:boolclustering_threshold:Union[int, float]clustering_variable:strinclude_nlp_data:boolhas_nlp:boolorg_entity_name:strper_entity_name:strloc_entity_name:strmisc_entity_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]🔄 ReturnLatestHeadlinesGetResponse🌐 Endpoint/api/latest_headlinesget🔙Back to Table of Contentsnewscatcher.latest_headlines.postThis endpoint allows you to get latest headlines. You need to specify since when you want to get the latest headlines. You can also filter by language, country, source, and more.🛠️ Usagepost_response=newscatcher.latest_headlines.post(when="7d",by_parse_date=False,lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",sources="string_example",predefined_sources="string_example",not_sources="string_example",ranked_only="string_example",is_headline=True,is_paid_content=True,parent_url="string_example",theme="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,clustering_enabled=True,clustering_threshold=3.14,clustering_variable="string_example",include_nlp_data=True,has_nlp=True,org_entity_name="string_example",per_entity_name="string_example",loc_entity_name="string_example",misc_entity_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parameterswhen:strby_parse_date:boollang:strnot_lang:strcountries:strnot_countries:strsources:strpredefined_sources:strnot_sources:strranked_only:stris_headline:boolis_paid_content:boolparent_url:strtheme:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intclustering_enabled:boolclustering_threshold:Union[int, float]clustering_variable:strinclude_nlp_data:boolhas_nlp:boolorg_entity_name:strper_entity_name:strloc_entity_name:strmisc_entity_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]⚙️ Request BodyLatestHeadlinesRequest🔄 ReturnLatestHeadlinesPostResponse🌐 Endpoint/api/latest_headlinespost🔙Back to Table of Contentsnewscatcher.search.getThis endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.🛠️ Usageget_response=newscatcher.search.get(q="q_example",search_in="title_content",predefined_sources="string_example",sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,clustering_enabled=True,clustering_threshold=3.14,clustering_variable="string_example",include_nlp_data=True,has_nlp=True,theme="string_example",org_entity_name="string_example",per_entity_name="string_example",loc_entity_name="string_example",misc_entity_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersq:strsearch_in:strpredefined_sources:strsources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]published_date_precision:strby_parse_date:boolsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intclustering_enabled:boolclustering_threshold:Union[int, float]clustering_variable:strinclude_nlp_data:boolhas_nlp:booltheme:strorg_entity_name:strper_entity_name:strloc_entity_name:strmisc_entity_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]🔄 ReturnSearchGetResponse🌐 Endpoint/api/searchget🔙Back to Table of Contentsnewscatcher.search.postThis endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.🛠️ Usagepost_response=newscatcher.search.post(q="string_example",search_in="title_content",predefined_sources="string_example",sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",published_date_precision="string_example",by_parse_date=False,sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,clustering_enabled=True,clustering_threshold=3.14,clustering_variable="string_example",include_nlp_data=True,has_nlp=True,theme="string_example",org_entity_name="string_example",per_entity_name="string_example",loc_entity_name="string_example",misc_entity_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersq:strsearch_in:strpredefined_sources:strsources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]published_date_precision:strby_parse_date:boolsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intclustering_enabled:boolclustering_threshold:Union[int, float]clustering_variable:strinclude_nlp_data:boolhas_nlp:booltheme:strorg_entity_name:strper_entity_name:strloc_entity_name:strmisc_entity_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]⚙️ Request BodySearchRequest🔄 ReturnSearchPostResponse🌐 Endpoint/api/searchpost🔙Back to Table of Contentsnewscatcher.search_similar.getThis endpoint returns a list of articles that are similar to the query provided. You also have the option to get similar articles for the results of a search.🛠️ Usageget_response=newscatcher.search_similar.get(q="q_example",search_in="title_content",include_similar_documents=False,similar_documents_number=5,similar_documents_fields="title,content",predefined_sources="string_example",sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",by_parse_date=False,published_date_precision="string_example",sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersq:strsearch_in:strinclude_similar_documents:boolsimilar_documents_number:intsimilar_documents_fields:strpredefined_sources:strsources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]by_parse_date:boolpublished_date_precision:strsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intinclude_nlp_data:boolhas_nlp:booltheme:strner_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]🔄 ReturnSearchSimilarGetResponse🌐 Endpoint/api/search_similarget🔙Back to Table of Contentsnewscatcher.search_similar.postThis endpoint returns a list of articles that are similar to the query provided. You also have the option to get similar articles for the results of a search.🛠️ Usagepost_response=newscatcher.search_similar.post(q="string_example",search_in="title_content",include_similar_documents=False,similar_documents_number=5,similar_documents_fields="title,content",predefined_sources="string_example",sources="string_example",not_sources="string_example",lang="string_example",not_lang="string_example",countries="string_example",not_countries="string_example",from_="string_example",to_="string_example",by_parse_date=False,published_date_precision="string_example",sort_by="relevancy",ranked_only="string_example",from_rank=1,to_rank=1,is_headline=True,is_paid_content=True,parent_url="string_example",all_links="string_example",all_domain_links="string_example",word_count_min=0,word_count_max=0,page=1,page_size=100,include_nlp_data=True,has_nlp=True,theme="string_example",ner_name="string_example",title_sentiment_min=3.14,title_sentiment_max=3.14,content_sentiment_min=3.14,content_sentiment_max=3.14,)⚙️ Parametersq:strsearch_in:strinclude_similar_documents:boolsimilar_documents_number:intsimilar_documents_fields:strpredefined_sources:strsources:strnot_sources:strlang:strnot_lang:strcountries:strnot_countries:strfrom_: Union[str,datetime]to_: Union[str,datetime]by_parse_date:boolpublished_date_precision:strsort_by:strranked_only:strfrom_rank:intto_rank:intis_headline:boolis_paid_content:boolparent_url:strall_links:strall_domain_links:strword_count_min:intword_count_max:intpage:intpage_size:intinclude_nlp_data:boolhas_nlp:booltheme:strner_name:strtitle_sentiment_min:Union[int, float]title_sentiment_max:Union[int, float]content_sentiment_min:Union[int, float]content_sentiment_max:Union[int, float]⚙️ Request BodyMoreLikeThisRequest🔄 ReturnSearchSimilarPostResponse🌐 Endpoint/api/search_similarpost🔙Back to Table of Contentsnewscatcher.sources.getThis endpoint allows you to get the list of sources that are available in the database. You can filter the sources by language and country. The maximum number of sources displayed is set according to your plan. You can find the list of plans and their features here:https://newscatcherapi.com/news-api#news-api-pricing🛠️ Usageget_response=newscatcher.sources.get(lang="string_example",countries="string_example",)⚙️ Parameterslang:strcountries:str🔄 ReturnSourceResponse🌐 Endpoint/api/sourcesget🔙Back to Table of Contentsnewscatcher.sources.postThis endpoint allows you to get the list of sources that are available in the database. You can filter the sources by language and country. The maximum number of sources displayed is set according to your plan. You can find the list of plans and their features here:https://newscatcherapi.com/news-api#news-api-pricing🛠️ Usagepost_response=newscatcher.sources.post(lang="string_example",countries="string_example",)⚙️ Parameterslang:strcountries:str⚙️ Request BodySourcesRequest🔄 ReturnSourceResponse🌐 Endpoint/api/sourcespost🔙Back to Table of Contentsnewscatcher.subscription.getThis endpoint allows you to get info about your subscription plan.🛠️ Usageget_response=newscatcher.subscription.get()🔄 ReturnSubscriptionResponse🌐 Endpoint/api/subscriptionget🔙Back to Table of Contentsnewscatcher.subscription.postThis endpoint allows you to get info about your subscription plan.🛠️ Usagepost_response=newscatcher.subscription.post()🔄 ReturnSubscriptionResponse🌐 Endpoint/api/subscriptionpost🔙Back to Table of ContentsAuthorThis Python package is automatically generated byKonfig