Skip to main content

Easily query articles

Project description


Python package that helps you easily retrieve complete web articles.

License: MIT pypi: newsdatascraper



pip3 install newsdatascraper


from newsdatascraper import Scraper
#To first get a single article on a topic
new_scraper = Scraper('mock-api-key')
articles = new_scraper.fetch_all_articles(query='two sigma', pageSize = 10)

We support two APIs: NewsApi and GNewsApi
To control the API being used change the argument of mode to either 'NEWSPAPER' or 'GNEWS'

new_scraper = Scraper('mock-api-key', mode = 'GNEWS')
articles = new_scraper.fetch_all_articles(query='two sigma', pageSize = 10, 
              dateFrom = "2019-08-04", dateTo = "2019-08-10")

#To access individual articles and their properties
first_article = articles.articles[0]
#We also provide helper functions to serialize the data

Important Note

Please look at rate limits in the APIs to determine your prefered usage

Working on the Project

Run format

black .

Run Linter

pylama -o setup.cfg .

Run tests


Run tests + code coverage

sh ./scripts/

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

newsdatascraper- (4.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page