Skip to main content

Client for NewsCatcher-V3 Production API

Project description

newscatcherapi-python-sdk



Visit our website https://newscatcherapi.com

PyPI README.md

Table of Contents

Requirements

Python >=3.7

Installation

pip install newscatcherapi-python-sdk==6.0.14

Getting Started

from pprint import pprint
from newscatcherapi_client import Newscatcher, ApiException

newscatcher = Newscatcher(
    api_key="YOUR_API_KEY",
)

try:
    # [Get] Search By Author Request
    get_response = newscatcher.authors.get(
        author_name="author_name_example",
        not_author_name="string_example",
        sources=None,
        predefined_sources=None,
        not_sources=None,
        lang=None,
        not_lang=None,
        countries=None,
        not_countries=None,
        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_opinion=True,
        is_paid_content=True,
        parent_url=None,
        all_links=None,
        all_domain_links=None,
        word_count_min=0,
        word_count_max=0,
        page=1,
        page_size=100,
        include_nlp_data=True,
        has_nlp=True,
        theme="string_example",
        not_theme="string_example",
        title_sentiment_min=3.14,
        title_sentiment_max=3.14,
        content_sentiment_min=3.14,
        content_sentiment_max=3.14,
        iptc_tags=None,
        not_iptc_tags=None,
        iab_tags=None,
        not_iab_tags=None,
    )
    print(get_response)
except ApiException as e:
    print("Exception when calling AuthorsApi.get: %s\n" % e)
    pprint(e.body)
    if e.status == 422:
        pprint(e.body["detail"])
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from newscatcherapi_client import Newscatcher, ApiException

newscatcher = Newscatcher(
    api_key="YOUR_API_KEY",
)


async def main():
    try:
        # [Get] Search By Author Request
        get_response = await newscatcher.authors.aget(
            author_name="author_name_example",
            not_author_name="string_example",
            sources=None,
            predefined_sources=None,
            not_sources=None,
            lang=None,
            not_lang=None,
            countries=None,
            not_countries=None,
            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_opinion=True,
            is_paid_content=True,
            parent_url=None,
            all_links=None,
            all_domain_links=None,
            word_count_min=0,
            word_count_max=0,
            page=1,
            page_size=100,
            include_nlp_data=True,
            has_nlp=True,
            theme="string_example",
            not_theme="string_example",
            title_sentiment_min=3.14,
            title_sentiment_max=3.14,
            content_sentiment_min=3.14,
            content_sentiment_max=3.14,
            iptc_tags=None,
            not_iptc_tags=None,
            iab_tags=None,
            not_iab_tags=None,
        )
        print(get_response)
    except ApiException as e:
        print("Exception when calling AuthorsApi.get: %s\n" % e)
        pprint(e.body)
        if e.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 Response

To access raw HTTP response values, use the .raw namespace.

from pprint import pprint
from newscatcherapi_client import Newscatcher, ApiException

newscatcher = Newscatcher(
    api_key="YOUR_API_KEY",
)

try:
    # [Get] Search By Author Request
    get_response = newscatcher.authors.raw.get(
        author_name="author_name_example",
        not_author_name="string_example",
        sources=None,
        predefined_sources=None,
        not_sources=None,
        lang=None,
        not_lang=None,
        countries=None,
        not_countries=None,
        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_opinion=True,
        is_paid_content=True,
        parent_url=None,
        all_links=None,
        all_domain_links=None,
        word_count_min=0,
        word_count_max=0,
        page=1,
        page_size=100,
        include_nlp_data=True,
        has_nlp=True,
        theme="string_example",
        not_theme="string_example",
        title_sentiment_min=3.14,
        title_sentiment_max=3.14,
        content_sentiment_min=3.14,
        content_sentiment_max=3.14,
        iptc_tags=None,
        not_iptc_tags=None,
        iab_tags=None,
        not_iab_tags=None,
    )
    pprint(get_response.body)
    pprint(get_response.headers)
    pprint(get_response.status)
    pprint(get_response.round_trip_time)
except ApiException as e:
    print("Exception when calling AuthorsApi.get: %s\n" % e)
    pprint(e.body)
    if e.status == 422:
        pprint(e.body["detail"])
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Reference

newscatcher.authors.get

This 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.

๐Ÿ› ๏ธ Usage

get_response = newscatcher.authors.get(
    author_name="author_name_example",
    not_author_name="string_example",
    sources=None,
    predefined_sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_theme="string_example",
    title_sentiment_min=3.14,
    title_sentiment_max=3.14,
    content_sentiment_min=3.14,
    content_sentiment_max=3.14,
    iptc_tags=None,
    not_iptc_tags=None,
    iab_tags=None,
    not_iab_tags=None,
)

โš™๏ธ Parameters

author_name: str
not_author_name: str
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
published_date_precision: str
by_parse_date: bool
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

๐Ÿ”„ Return

AuthorsGetResponse

๐ŸŒ Endpoint

/api/authors get

๐Ÿ”™ Back to Table of Contents


newscatcher.authors.post

This 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.

๐Ÿ› ๏ธ Usage

post_response = newscatcher.authors.post(
    author_name="string_example",
    not_author_name="string_example",
    sources=None,
    predefined_sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_theme="string_example",
    title_sentiment_min=3.14,
    title_sentiment_max=3.14,
    content_sentiment_min=3.14,
    content_sentiment_max=3.14,
    iptc_tags=None,
    not_iptc_tags=None,
    iab_tags=None,
    not_iab_tags=None,
)

โš™๏ธ Parameters

author_name: str
not_author_name: str
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
published_date_precision: str
by_parse_date: bool
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

โš™๏ธ Request Body

AuthorSearchRequest

๐Ÿ”„ Return

AuthorsPostResponse

๐ŸŒ Endpoint

/api/authors post

๐Ÿ”™ Back to Table of Contents


newscatcher.latest_headlines.get

This 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.

๐Ÿ› ๏ธ Usage

get_response = newscatcher.latest_headlines.get(
    when="7d",
    by_parse_date=False,
    sort_by="relevancy",
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    sources=None,
    predefined_sources=None,
    not_sources=None,
    not_author_name=None,
    ranked_only="string_example",
    is_headline=True,
    is_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    clustering_variable="string_example",
    clustering_enabled=True,
    clustering_threshold=3.14,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_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,
    iptc_tags=None,
    not_iptc_tags=None,
    iab_tags=None,
    not_iab_tags=None,
)

โš™๏ธ Parameters

when: str
by_parse_date: bool
sort_by: str
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_author_name: Union[bool, date, datetime, dict, float, int, list, str, None]
ranked_only: Union[str, bool]
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
clustering_variable: str
clustering_enabled: bool
clustering_threshold: Union[int, float]
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
org_entity_name: str
per_entity_name: str
loc_entity_name: str
misc_entity_name: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

๐Ÿ”„ Return

LatestHeadlinesGetResponse

๐ŸŒ Endpoint

/api/latest_headlines get

๐Ÿ”™ Back to Table of Contents


newscatcher.latest_headlines.post

This 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.

๐Ÿ› ๏ธ Usage

post_response = newscatcher.latest_headlines.post(
    when="7d",
    by_parse_date=False,
    sort_by="relevancy",
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    sources=None,
    predefined_sources=None,
    not_sources=None,
    not_author_name=None,
    ranked_only="string_example",
    is_headline=True,
    is_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    clustering_variable="string_example",
    clustering_enabled=True,
    clustering_threshold=3.14,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_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,
    iptc_tags=None,
    not_iptc_tags=None,
    iab_tags=None,
    not_iab_tags=None,
)

โš™๏ธ Parameters

when: str
by_parse_date: bool
sort_by: str
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_author_name: Union[bool, date, datetime, dict, float, int, list, str, None]
ranked_only: Union[str, bool]
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
clustering_variable: str
clustering_enabled: bool
clustering_threshold: Union[int, float]
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
org_entity_name: str
per_entity_name: str
loc_entity_name: str
misc_entity_name: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

โš™๏ธ Request Body

LatestHeadlinesRequest

๐Ÿ”„ Return

LatestHeadlinesPostResponse

๐ŸŒ Endpoint

/api/latest_headlines post

๐Ÿ”™ Back to Table of Contents


newscatcher.search.get

This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.

๐Ÿ› ๏ธ Usage

get_response = newscatcher.search.get(
    q="q_example",
    search_in="title_content",
    predefined_sources=None,
    sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    not_author_name=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    clustering_variable="string_example",
    clustering_enabled=True,
    clustering_threshold=3.14,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_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,
    iptc_tags=None,
    not_iptc_tags=None,
    source_name=None,
    iab_tags=None,
    not_iab_tags=None,
    exclude_duplicates=True,
    additional_domain_info=True,
    is_news_domain=True,
    news_domain_type=None,
    news_type=None,
)

โš™๏ธ Parameters

q: str
search_in: str
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_author_name: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
published_date_precision: str
by_parse_date: bool
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
clustering_variable: str
clustering_enabled: bool
clustering_threshold: Union[int, float]
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
org_entity_name: str
per_entity_name: str
loc_entity_name: str
misc_entity_name: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
source_name: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
exclude_duplicates: bool
additional_domain_info: bool
is_news_domain: bool
news_domain_type: Union[bool, date, datetime, dict, float, int, list, str, None]
news_type: Union[bool, date, datetime, dict, float, int, list, str, None]

๐Ÿ”„ Return

SearchGetResponse

๐ŸŒ Endpoint

/api/search get

๐Ÿ”™ Back to Table of Contents


newscatcher.search.post

This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.

๐Ÿ› ๏ธ Usage

post_response = newscatcher.search.post(
    q="string_example",
    search_in="title_content",
    predefined_sources=None,
    sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    not_author_name=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    clustering_variable="string_example",
    clustering_enabled=True,
    clustering_threshold=3.14,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_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,
    iptc_tags=None,
    not_iptc_tags=None,
    source_name=None,
    iab_tags=None,
    not_iab_tags=None,
    exclude_duplicates=True,
    additional_domain_info=True,
    is_news_domain=True,
    news_domain_type=None,
    news_type=None,
)

โš™๏ธ Parameters

q: str
search_in: str
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_author_name: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
published_date_precision: str
by_parse_date: bool
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
clustering_variable: str
clustering_enabled: bool
clustering_threshold: Union[int, float]
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
org_entity_name: str
per_entity_name: str
loc_entity_name: str
misc_entity_name: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
source_name: Union[bool, date, datetime, dict, float, int, list, str, None]
iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iab_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
exclude_duplicates: bool
additional_domain_info: bool
is_news_domain: bool
news_domain_type: Union[bool, date, datetime, dict, float, int, list, str, None]
news_type: Union[bool, date, datetime, dict, float, int, list, str, None]

โš™๏ธ Request Body

SearchRequest

๐Ÿ”„ Return

SearchPostResponse

๐ŸŒ Endpoint

/api/search post

๐Ÿ”™ Back to Table of Contents


newscatcher.search_link.get

This endpoint allows you to search for articles. You can search for articles by id(s) or link(s).

๐Ÿ› ๏ธ Usage

get_response = newscatcher.search_link.get(
    ids=None,
    links=None,
    from_="string_example",
    to_="string_example",
    page=1,
    page_size=100,
)

โš™๏ธ Parameters

ids: Union[bool, date, datetime, dict, float, int, list, str, None]
links: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
page: int
page_size: int

๐Ÿ”„ Return

DtoResponsesSearchResponseSearchResponse

๐ŸŒ Endpoint

/api/search_by_link get

๐Ÿ”™ Back to Table of Contents


newscatcher.search_link.post

This endpoint allows you to search for articles. You can search for articles by id(s) or link(s).

๐Ÿ› ๏ธ Usage

post_response = newscatcher.search_link.post(
    ids=None,
    links=None,
    from_="string_example",
    to_="string_example",
    page=1,
    page_size=100,
)

โš™๏ธ Parameters

ids: Union[bool, date, datetime, dict, float, int, list, str, None]
links: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
page: int
page_size: int

โš™๏ธ Request Body

SearchURLRequest

๐Ÿ”„ Return

DtoResponsesSearchResponseSearchResponse

๐ŸŒ Endpoint

/api/search_by_link post

๐Ÿ”™ Back to Table of Contents


newscatcher.search_similar.get

This 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.

๐Ÿ› ๏ธ Usage

get_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=None,
    sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_theme="string_example",
    title_sentiment_min=3.14,
    title_sentiment_max=3.14,
    content_sentiment_min=3.14,
    content_sentiment_max=3.14,
    iptc_tags=None,
    not_iptc_tags=None,
)

โš™๏ธ Parameters

q: str
search_in: str
include_similar_documents: bool
similar_documents_number: int
similar_documents_fields: str
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
by_parse_date: bool
published_date_precision: str
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

๐Ÿ”„ Return

SearchSimilarGetResponse

๐ŸŒ Endpoint

/api/search_similar get

๐Ÿ”™ Back to Table of Contents


newscatcher.search_similar.post

This 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.

๐Ÿ› ๏ธ Usage

post_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=None,
    sources=None,
    not_sources=None,
    lang=None,
    not_lang=None,
    countries=None,
    not_countries=None,
    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_opinion=True,
    is_paid_content=True,
    parent_url=None,
    all_links=None,
    all_domain_links=None,
    word_count_min=0,
    word_count_max=0,
    page=1,
    page_size=100,
    include_nlp_data=True,
    has_nlp=True,
    theme="string_example",
    not_theme="string_example",
    title_sentiment_min=3.14,
    title_sentiment_max=3.14,
    content_sentiment_min=3.14,
    content_sentiment_max=3.14,
    iptc_tags=None,
    not_iptc_tags=None,
)

โš™๏ธ Parameters

q: str
search_in: str
include_similar_documents: bool
similar_documents_number: int
similar_documents_fields: str
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
sources: Union[bool, date, datetime, dict, float, int, list, str, None]
not_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
lang: Union[bool, date, datetime, dict, float, int, list, str, None]
not_lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
not_countries: Union[bool, date, datetime, dict, float, int, list, str, None]
from_: Union[str, datetime]
to_: Union[str, datetime]
by_parse_date: bool
published_date_precision: str
sort_by: str
ranked_only: Union[str, bool]
from_rank: int
to_rank: int
is_headline: bool
is_opinion: bool
is_paid_content: bool
parent_url: Union[bool, date, datetime, dict, float, int, list, str, None]
all_links: Union[bool, date, datetime, dict, float, int, list, str, None]
all_domain_links: Union[bool, date, datetime, dict, float, int, list, str, None]
word_count_min: int
word_count_max: int
page: int
page_size: int
include_nlp_data: bool
has_nlp: bool
theme: str
not_theme: str
title_sentiment_min: Union[int, float]
title_sentiment_max: Union[int, float]
content_sentiment_min: Union[int, float]
content_sentiment_max: Union[int, float]
iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]
not_iptc_tags: Union[bool, date, datetime, dict, float, int, list, str, None]

โš™๏ธ Request Body

MoreLikeThisRequest

๐Ÿ”„ Return

SearchSimilarPostResponse

๐ŸŒ Endpoint

/api/search_similar post

๐Ÿ”™ Back to Table of Contents


newscatcher.sources.get

This 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

๐Ÿ› ๏ธ Usage

get_response = newscatcher.sources.get(
    lang=None,
    countries=None,
    predefined_sources=None,
    include_additional_info=True,
    from_rank=1,
    to_rank=1,
    source_name=None,
    source_url=None,
    is_news_domain=True,
    news_domain_type=None,
    news_type=None,
)

โš™๏ธ Parameters

lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
include_additional_info: bool
from_rank: int
to_rank: int
source_name: Union[bool, date, datetime, dict, float, int, list, str, None]
source_url: Union[bool, date, datetime, dict, float, int, list, str, None]
is_news_domain: bool
news_domain_type: Union[bool, date, datetime, dict, float, int, list, str, None]
news_type: Union[bool, date, datetime, dict, float, int, list, str, None]

๐Ÿ”„ Return

SourceResponse

๐ŸŒ Endpoint

/api/sources get

๐Ÿ”™ Back to Table of Contents


newscatcher.sources.post

This 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

๐Ÿ› ๏ธ Usage

post_response = newscatcher.sources.post(
    lang=None,
    countries=None,
    predefined_sources=None,
    include_additional_info=True,
    from_rank=1,
    to_rank=1,
    source_name=None,
    source_url=None,
    is_news_domain=True,
    news_domain_type=None,
    news_type=None,
)

โš™๏ธ Parameters

lang: Union[bool, date, datetime, dict, float, int, list, str, None]
countries: Union[bool, date, datetime, dict, float, int, list, str, None]
predefined_sources: Union[bool, date, datetime, dict, float, int, list, str, None]
include_additional_info: bool
from_rank: int
to_rank: int
source_name: Union[bool, date, datetime, dict, float, int, list, str, None]
source_url: Union[bool, date, datetime, dict, float, int, list, str, None]
is_news_domain: bool
news_domain_type: Union[bool, date, datetime, dict, float, int, list, str, None]
news_type: Union[bool, date, datetime, dict, float, int, list, str, None]

โš™๏ธ Request Body

SourcesRequest

๐Ÿ”„ Return

SourceResponse

๐ŸŒ Endpoint

/api/sources post

๐Ÿ”™ Back to Table of Contents


newscatcher.subscription.get

This endpoint allows you to get info about your subscription plan.

๐Ÿ› ๏ธ Usage

get_response = newscatcher.subscription.get()

๐Ÿ”„ Return

SubscriptionResponse

๐ŸŒ Endpoint

/api/subscription get

๐Ÿ”™ Back to Table of Contents


newscatcher.subscription.post

This endpoint allows you to get info about your subscription plan.

๐Ÿ› ๏ธ Usage

post_response = newscatcher.subscription.post()

๐Ÿ”„ Return

SubscriptionResponse

๐ŸŒ Endpoint

/api/subscription post

๐Ÿ”™ Back to Table of Contents


Author

This Python package is automatically generated by Konfig

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newscatcherapi_python_sdk-6.0.14.tar.gz (204.4 kB view details)

Uploaded Source

Built Distribution

newscatcherapi_python_sdk-6.0.14-py3-none-any.whl (402.0 kB view details)

Uploaded Python 3

File details

Details for the file newscatcherapi_python_sdk-6.0.14.tar.gz.

File metadata

File hashes

Hashes for newscatcherapi_python_sdk-6.0.14.tar.gz
Algorithm Hash digest
SHA256 224dc7b1960489a1374e47ad1e8d5290e04689a89d5f3131b9995d2cc1dc96d5
MD5 f376a8c0764d16b0ee2fd555893a750a
BLAKE2b-256 03138fdf9bc24651ac7717e8ed0dee0c5dfc01a2730b579b35c41c49116b18ac

See more details on using hashes here.

File details

Details for the file newscatcherapi_python_sdk-6.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for newscatcherapi_python_sdk-6.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 69d16b4db129ee5db46b23639c73e894e716ab7c3596365ef0e03e130c328bc9
MD5 db9d2eb70a6a0ca51a88da40540a2dbd
BLAKE2b-256 6303ebdd27dc6ac6aa65a316e55dd7c1217f26372da547366477b819fca85152

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page