aylien_news_api
AylienNewsApi - the Ruby gem for the AYLIEN News API
The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 5.2.3
- Package version: 5.2.3
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
For more information, please visit https://newsapi.aylien.com/
Installation
Build a gem
To build the Ruby code into a gem:
gem build aylien_news_api.gemspec
Then either install the gem locally:
gem install ./aylien_news_api-5.2.3.gem
(for development, run gem install --dev ./aylien_news_api-5.2.3.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'aylien_news_api', '~> 5.2.3'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'aylien_news_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
require 'aylien_news_api'
AylienNewsApi.configure do |config|
config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR API KEY'
config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR API KEY'
end
api_instance = AylienNewsApi::DefaultApi.new
unknown_base_type = {"$and":[{"$or":[{"body":{"$text":"Tim Cook"}},{"social.shares.count.reddit.max":{"$gte":5000,"$boost":5}}]},{"entity":{"$and":[{"name":{"$text":"Apple","$boost":2}},{"$not":[{"type":{"$eq":"Fruit"}}]}]}}]}
opts = {
published_at_start: 'published_at_start_example',
published_at_end: 'published_at_end_example',
_return: ['_return_example'],
sort_by: 'published_at',
sort_direction: 'desc',
cursor: '*',
per_page: 10
}
begin
result = api_instance.advanced_list_stories(unknown_base_type, opts)
p result
rescue AylienNewsApi::ApiError => e
puts "Exception when calling DefaultApi->advanced_list_stories: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://api.aylien.com/news
Documentation for Models
Documentation for Authorization
app_id
- Type: API key
- API key parameter name: X-AYLIEN-NewsAPI-Application-ID
- Location: HTTP header
app_key
- Type: API key
- API key parameter name: X-AYLIEN-NewsAPI-Application-Key
- Location: HTTP header