Skip to main content

Python SDK for AskNews

Project description

AskNews Python SDk

PyPI - Python Version

Python SDK for the AskNews API.

Installation

pip install asknews

Usage

import asyncio
from asknews_sdk import AskNewsSDK

async def main():
    async with AskNewsSDK(
        client_id="your_client_id",
        client_secret="your_client_secret",
        scopes=["chat", "news", "stories"],
    ) as sdk:
        response = await sdk.stories.get_stories(query="covid", n_stories=50, method="nl")
        print(response)

        response = await sdk.news.search_news(query="covid", n_articles=50, method="nl")
        print(response)

if __name__ == "__main__":
    asyncio.run(main())

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

asknews-0.3.9-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

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