Newsie v0.1.0 Newsie.Providers.CurrentsApi View Source
Client for Currents API
Configuration
Requires :api_key
to use.
See Newsie.ProviderConfig
for documentation on how to configure providers.
Link to this section Summary
Functions
Get a list of supported categories
Get a list of supported languages.
Get a list of supported regions.
Get latest news for the given language
Search for news articles
Link to this section Functions
Specs
config() :: keyword()
Specs
Get a list of supported categories
Specs
Get a list of supported languages.
Specs
Get a list of supported regions.
These are mostly ISO country codes, but some are regions like 'ASIA' and 'INT'
Specs
latest_news(String.t()) :: {:error, any()} | {:ok, [Newsie.Article.t()]}
Get latest news for the given language
Specs
search(keyword()) :: {:error, any()} | {:ok, [Newsie.Article.t()]}
Search for news articles
Search parameters
type
(see below)category
(see below)language
(ISO-639-2 code)keywords
country
(ISO-3166 code)start_date
(ISO-8601 timestamp)end_date
(ISO-8601 timestamp)
Type
The Currents API provides differnt kinds of content; not just new.
The type
filter controls the kind of content you want.
- 1 = news (default)
- 2 = article
- 3 = discussion content
Category
- "regional"
- "technology"
- "lifestyle"
- "business"
- "general"
- "programming"
- "science"
- "entertainment"
- "world"
- "sports"
- "finance"
- "academia"
- "politics"
- "health"
- "opinion"
- "food"
- "game"
Usage
Newsie.Providers.CurrentsApi.search(language: :en, country: :us, category: "business")