biomunky / newsapi

An API for interacting with the News API
MIT License
7 stars 2 forks source link
learning-by-doing rust rust-library

The News API Rust Library

Build Status

The News API allows you to get breaking news headlines, and search for articles from over 30,000 news sources and blogs.

Breaking changes**

Summary

All you need is an API key to

The following limits apply

See here for pricing

Notes

There are three endpoints

  1. Top Headlines
  2. Everything
  3. Sources

Top Headlines and Everything endpoints are wrapped by an Article struct and Sources by a Source struct. Both currently provide limited functionality.

Examples

As described in The Cargo Book the project has some simple examples in examples/. These can be run via cargo after you've exported your NEWSAPI_KEY

export NEWSAPI_KEY=5h79off128957edb3179y5da1nb36y9e

To list all examples:

cargo run --example

to run a specific example

cargo run --example get_sources_async

License

Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Disclaimer

We have no affiliation with the News API team.