You’re currently viewing the current News API Documentation. If you signed up as a user prior to October 29th you should refer to the Legacy News API documentation.

Endpoints

The News API includes endpoints that provide both retrieval and analysis features that allow you to search, collect, and analyze news content at scale.

Our retrieval endpoints:

Our analysis endpoints:

The OpenAPI 3.0 specification for our endpoints are available on GitHub under the AYLIEN/apis repository.

Clusters

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()

# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_ID'
configuration = aylien_news_api.Configuration()

# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'
configuration.host = "https://api.aylien.com/news"

# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
    'id': [123],
    'not_id': [132],
    'story_count_min': 123,
    'story_count_max': 1234,
    'time_start': 'NOW-3DAYS/DAY',
    'time_end': 'NOW-1DAY/DAY',
    'earliest_story_start': 'earliest_story_start_example',
    'earliest_story_end': 'earliest_story_end_example',
    'latest_story_start': 'latest_story_start_example',
    'latest_story_end': 'latest_story_end_example',
    'location_country': ['location_country_example'],
    'not_location_country': ['location_country_example']
    }

try:
    # List Clusters
    api_response = api_instance.list_clusters(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_clusters: %s\n" % e)
# load the gem
require 'aylien_news_api'

# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_ID'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_APP_KEY'
end

api_instance = AylienNewsApi::DefaultApi.new
opts = {
  :id => [123],
  :not_id => [321],
  :story_count_min => 1,
  :story_count_max => 35,
  :time_start => 'NOW-7DAYS/DAY',
  :time_end => 'NOW',
  :earliest_story_start => 'NOW-8DAYS/DAY',
  :earliest_story_end => 'NOW/DAY',  
  :latest_story_start => 'NOW-8DAYS/DAY',
  :latest_story_end => 'NOW/DAY',
  :location_country => ['US'],
  :not_location_country => ['GB']
}

begin
  #List Clusters
  result = api_instance.list_clusters(opts)
  p result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_clusters: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_ID');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$opts = array(
  'id' => array(56),
  'not_id' => array(56),
  'story_count_min' => 1,
  'story_count_max' => 35,
  'time_start' => 'NOW-7DAYS/DAY',
  'time_end' => 'NOW',
  'earliest_story_start' => 'NOW/DAY',
  'earliest_story_end' => 'NOW-8DAYS/DAY',
  'latest_story_start' => 'NOW/DAY',
  'latest_storyEnd' => 'NOW-8DAYS/DAY',
  'location_country' => array('IE'),
  'not_location_country' => array('GB'),
);

try {
    $result = $apiInstance->listClusters($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listClusters: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require("aylien-news-api");
var defaultClient = AylienNewsApi.ApiClient.instance;

// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR APP ID';

// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR API KEY';

var apiInstance = new AylienNewsApi.DefaultApi();
var opts = {
  'id': [null],
  'notId': [null],
  'storyCountMin': 56,
  'storyCountMax': 56,
  'timeStart': "timeStart_example",
  'timeEnd': "timeEnd_example",
  'earliestStoryStart': "earliestStoryStart_example",
  'earliestStoryEnd': "earliestStoryEnd_example",
  'latestStoryStart': "latestStoryStart_example",
  'latestStoryEnd': "latestStoryEnd_example",
  'locationCountry': ["IE"],
  'notLocationCountry': ["IN"]
};
apiInstance.listClusters(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.clusters);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi

  clustersParams := &newsapi.ListClustersOpts{
    Id:                             optional.NewInterface([]int64{123}),
    NotId:                          optional.NewInterface([]int64{123}),
    StoryCountMin:                  optional.NewInt32(3),
    StoryCountMax:                  optional.NewInt32(200),            
    TimeStart:                      optional.NewString("NOW-7DAYS"), 
    TimeEnd:                        optional.NewString("NOW-2DAYS"),
    EarliestStoryStart:             optional.NewString("NOW-7DAYS"),
    EarliestStoryEnd:               optional.NewString("NOW-1DAY"),
    LatestStoryStart:               optional.NewString("NOW-7DAYS"),
    LatestStoryEnd:                 optional.NewString("NOW-2DAYS"),
    LocationCountry:                optional.NewInterface([]string{"IE"}),
    NotLocationCountry:             optional.NewInterface([]string{"IN"}),
  }

  clustersResponse, res, err := api.ListClusters(context.Background(), clustersParams)

  if err != nil {
    panic(err)
  }

  _ = res

  for _, cluster := range clustersResponse.Clusters {
    fmt.Println(cluster)
  }
}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    List<Long> id = Arrays.asList();  
    List<Long> notId = Arrays.asList();  
    Integer storyCountMin = 56;  
    Integer storyCountMax = 56;  
    String timeStart = "timeStart_example";  
    String timeEnd = "timeEnd_example";  
    String earliestStoryStart = "earliestStoryStart_example";  
    String earliestStoryEnd = "earliestStoryEnd_example";  
    String latestStoryStart = "latestStoryStart_example";  
    String latestStoryEnd = "latestStoryEnd_example";  
    List<String> locationCountry = Arrays.asList("IE");  
    List<String> notLocationCountry = Arrays.asList("IN");

    try {
      Clusters result = apiInstance.listClusters()
            .id(id)
            .notId(notId)
            .storyCountMin(storyCountMin)
            .storyCountMax(storyCountMax)
            .timeStart(timeStart)
            .timeEnd(timeEnd)
            .earliestStoryStart(earliestStoryStart)
            .earliestStoryEnd(earliestStoryEnd)
            .latestStoryStart(latestStoryStart)
            .latestStoryEnd(latestStoryEnd)
            .locationCountry(locationCountry)
            .notLocationCountry(notLocationCountry)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#listClusters");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

The News API’s clustering feature groups related stories into clusters. These clusters typically correspond to real-world events or topics.

The Clusters endpoint is used to retrieve cluster objects. A cluster object includes a unique cluster ID, some metadata about the cluster, and a story that best represents the cluster. Stories associated with a cluster can be retrieved by calling the Stories endpoint with the cluster ID supplied as the clusters[] parameter.

To learn more about working with clustering, go to the Working With Clusters documentation page.

HTTP Request

GET https://api.aylien.com/news/clusters

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

id[]
array [integer]
(query)

This parameter allows you to retrieve specific clusters by their id which is specified with a list of int64 values.

story_count.min
int64
(query)

This parameter allows you to specify the minimum number stories that retrieved clusters should be associated with. Default value is 2.

story_count.max
int64
(query)

This parameter allows you to specify clusters that have a maximum number of stories associated with them.

earliest_story.start
ISO 8601
(query)

This parameter allows you to specify clusters whose earliest story was published after a specified time stamp.

earliest_story.end
ISO 8601
(query)

This parameter allows you to specify clusters whose earliest story was published before a specified time stamp.

latest_story.start
ISO 8601
(query)

This parameter allows you to specify clusters whose latest story was published after a specified time stamp.

latest_story.end
ISO 8601
(query)

This parameter allows you to specify clusters whose latest story was published before a specified time stamp

time.start
ISO 8601
(query)

This parameter allows you to retrieve clusters for which the associated event’s time is after a specified time stamp.

time.end
ISO 8601
(query)

This parameter allows you to retrieve clusters for which the associated event’s time is before a specified time stamp.

location_country
array [string]
(query)

This parameter allows you to specify clusters that refer to events in specifc countries. It supports ISO 3166-1 alpha-2 country codes.

not_location_country
array [string]
(query)

This parameter allows you to specify clusters that do not refer to events in specifc countries. It supports ISO 3166-1 alpha-2 country codes.

sort_by
string
(query)

This parameter allows you to specify the parameter by which your results will be sorted. The accepted values are: - `story_count` - `earliest_story` - `latest_story` - `time`

sort_direction
string
(query)

This parameter allows you to specify the sort direction of your results. The accepted values are `asc` and `desc`.

per_page
int64
(query)

This parameter allows you to specify the maximum number of clusters to be returned by your query. The maximum value is 100, for more than 100 results `cursor` can be used.

cursor
string
(query)

This parameter allows you to chain your requests in calls that return more than 100 clusters by supplying the `next_page_cursor` response to your next call. For more information about using cursor with the News API, take a look at the documentation page.

Stories

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()

# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_KEY'

# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'

# Defining host is optional and default to https://api.aylien.com/news
configuration.host = "https://api.aylien.com/news"
# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
  'id': [56], 
  'not_id': [56], 
  'title': 'title_example', 
  'body': 'body_example', 
  'text': 'text_example', 
  'translations_en_title': 'translations_en_title_example', 
  'translations_en_body': 'translations_en_body_example', 
  'translations_en_text': 'translations_en_text_example', 
  'language': ['language_example'], 
  'not_language': ['language_example'], 
  'published_at_start': 'published_at_start_example', 
  'published_at_end': 'published_at_end_example', 
  'categories_taxonomy': 'categories_taxonomy_example', 
  'categories_confident': True, 
  'categories_id': ['categories_id_example'], 
  'not_categories_id': ['categories_id_example'], 
  'categories_level': [56], 
  'not_categories_level': [56], 
  'entities_title_text': ['entities_title_text_example'], 
  'not_entities_title_text': ['entities_title_text_example'], 
  'entities_title_type': ['entities_title_type_example'], 
  'not_entities_title_type': ['entities_title_type_example'], 
  'entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'not_entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'entities_body_text': ['entities_body_text_example'], 
  'not_entities_body_text': ['entities_body_text_example'], 
  'entities_body_type': ['entities_body_type_example'], 
  'not_entities_body_type': ['entities_body_type_example'], 
  'entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'not_entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'media_images_count_min': 56, 
  'media_images_count_max': 56, 
  'media_images_width_min': 56, 
  'media_images_width_max': 56, 
  'media_images_height_min': 56, 
  'media_images_height_max': 56, 
  'media_images_content_length_min': 56, 
  'media_images_content_length_max': 56, 
  'media_images_format': ['media_images_format_example'], 
  'not_media_images_format': ['media_images_format_example'], 
  'media_videos_count_min': 56, 
  'media_videos_count_max': 56, 
  'author_id': [56], 
  'not_author_id': [56], 
  'author_name': 'author_name_example', 
  'not_author_name': 'author_name_example', 
  'source_id': [56], 
  'not_source_id': [56], 
  'source_name': ['source_name_example'], 
  'not_source_name': ['source_name_example'], 
  'source_domain': ['source_domain_example'], 
  'not_source_domain': ['source_domain_example'], 
  'source_locations_country': ['source_locations_country_example'], 
  'not_source_locations_country': ['source_locations_country_example'], 
  'source_locations_state': ['source_locations_state_example'], 
  'not_source_locations_state': ['source_locations_state_example'], 
  'source_locations_city': ['source_locations_city_example'], 
  'not_source_locations_city': ['source_locations_city_example'], 
  'source_scopes_country': ['source_scopes_country_example'], 
  'not_source_scopes_country': ['source_scopes_country_example'], 
  'source_scopes_state': ['source_scopes_state_example'], 
  'not_source_scopes_state': ['source_scopes_state_example'], 
  'source_scopes_city': ['source_scopes_city_example'], 
  'not_source_scopes_city': ['source_scopes_city_example'], 
  'source_scopes_level': ['source_scopes_level_example'], 
  'not_source_scopes_level': ['source_scopes_level_example'], 
  'source_links_in_count_min': 56, 
  'source_links_in_count_max': 56, 
  'source_rankings_alexa_rank_min': 56, 
  'source_rankings_alexa_rank_max': 56, 
  'source_rankings_alexa_country': ['source_rankings_alexa_country_example'], 
  'social_shares_count_facebook_min': 56, 
  'social_shares_count_facebook_max': 56, 
  'social_shares_count_google_plus_min': 56, 
  'social_shares_count_google_plus_max': 56, 
  'social_shares_count_linkedin_min': 56, 
  'social_shares_count_linkedin_max': 56, 
  'social_shares_count_reddit_min': 56, 
  'social_shares_count_reddit_max': 56, 
  'clusters': ['clusters_example'], 
  '_return': ['_return_example'], 
  'sort_by': 'published_at', 
  'sort_direction': 'desc', 
  'cursor': '*', 
  'per_page': 10 
}
try:
    # List Stories
    api_response = api_instance.list_stories(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_stories: %s\n" % e)
# load the gem
require 'aylien_news_api'
require 'pp'
# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = "YOUR APP ID"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = "YOUR API KEY"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new

opts = {
  :id => [56], 
  :not_id => [56], 
  :title => 'title_example', 
  :body => 'body_example', 
  :text => 'text_example', 
  :translations_en_title => 'translations_en_title_example', 
  :translations_en_body => 'translations_en_body_example', 
  :translations_en_text => 'translations_en_text_example', 
  :language => ['language_example'], 
  :not_language => ['language_example'], 
  :published_at_start => 'published_at_start_example', 
  :published_at_end => 'published_at_end_example', 
  :categories_taxonomy => 'categories_taxonomy_example', 
  :categories_confident => true, 
  :categories_id => ['categories_id_example'], 
  :not_categories_id => ['categories_id_example'], 
  :categories_level => [56], 
  :not_categories_level => [56], 
  :entities_title_text => ['entities_title_text_example'], 
  :not_entities_title_text => ['entities_title_text_example'], 
  :entities_title_type => ['entities_title_type_example'], 
  :not_entities_title_type => ['entities_title_type_example'], 
  :entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :not_entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :entities_body_text => ['entities_body_text_example'], 
  :not_entities_body_text => ['entities_body_text_example'], 
  :entities_body_type => ['entities_body_type_example'], 
  :not_entities_body_type => ['entities_body_type_example'], 
  :entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :not_entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :not_sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :not_sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :media_images_count_min => 56, 
  :media_images_count_max => 56, 
  :media_images_width_min => 56, 
  :media_images_width_max => 56, 
  :media_images_height_min => 56, 
  :media_images_height_max => 56, 
  :media_images_content_length_min => 56, 
  :media_images_content_length_max => 56, 
  :media_images_format => ['media_images_format_example'], 
  :not_media_images_format => ['media_images_format_example'], 
  :media_videos_count_min => 56, 
  :media_videos_count_max => 56, 
  :author_id => [56], 
  :not_author_id => [56], 
  :author_name => 'author_name_example', 
  :not_author_name => 'author_name_example', 
  :source_id => [56], 
  :not_source_id => [56], 
  :source_name => ['source_name_example'], 
  :not_source_name => ['source_name_example'], 
  :source_domain => ['source_domain_example'], 
  :not_source_domain => ['source_domain_example'], 
  :source_locations_country => ['source_locations_country_example'], 
  :not_source_locations_country => ['source_locations_country_example'], 
  :source_locations_state => ['source_locations_state_example'], 
  :not_source_locations_state => ['source_locations_state_example'], 
  :source_locations_city => ['source_locations_city_example'], 
  :not_source_locations_city => ['source_locations_city_example'], 
  :source_scopes_country => ['source_scopes_country_example'], 
  :not_source_scopes_country => ['source_scopes_country_example'], 
  :source_scopes_state => ['source_scopes_state_example'], 
  :not_source_scopes_state => ['source_scopes_state_example'], 
  :source_scopes_city => ['source_scopes_city_example'], 
  :not_source_scopes_city => ['source_scopes_city_example'], 
  :source_scopes_level => ['source_scopes_level_example'], 
  :not_source_scopes_level => ['source_scopes_level_example'], 
  :source_links_in_count_min => 56, 
  :source_links_in_count_max => 56, 
  :source_rankings_alexa_rank_min => 56, 
  :source_rankings_alexa_rank_max => 56, 
  :source_rankings_alexa_country => ['source_rankings_alexa_country_example'], 
  :social_shares_count_facebook_min => 56, 
  :social_shares_count_facebook_max => 56, 
  :social_shares_count_google_plus_min => 56, 
  :social_shares_count_google_plus_max => 56, 
  :social_shares_count_linkedin_min => 56, 
  :social_shares_count_linkedin_max => 56, 
  :social_shares_count_reddit_min => 56, 
  :social_shares_count_reddit_max => 56, 
  :clusters => ['clusters_example'], 
  :_return => ['title'], 
  :sort_by => 'published_at', 
  :sort_direction => 'desc', 
  :cursor => '*', 
  :per_page => 10 
}

begin
  #List Stories
  result = api_instance.list_stories(opts)
  pp result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_stories: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$opts = array(
  'id' => array(56), 
  'not_id' => array(56), 
  'title' => 'Liverpool', 
  'body' => 'body_example', 
  'text' => 'text_example', 
  'translations_en_title' => 'translations_en_title_example', 
  'translations_en_body' => 'translations_en_body_example', 
  'translations_en_text' => 'translations_en_text_example', 
  'language' => array('language_example'), 
  'not_language' => array('language_example'), 
  'published_at_start' => 'published_at_start_example', 
  'published_at_end' => 'published_at_end_example', 
  'categories_taxonomy' => 'categories_taxonomy_example', 
  'categories_confident' => true, 
  'categories_id' => array('categories_id_example'), 
  'not_categories_id' => array('categories_id_example'), 
  'categories_level' => array(56), 
  'not_categories_level' => array(56), 
  'entities_title_text' => array('entities_title_text_example'), 
  'not_entities_title_text' => array('entities_title_text_example'), 
  'entities_title_type' => array('entities_title_type_example'), 
  'not_entities_title_type' => array('entities_title_type_example'), 
  'entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
  'not_entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
  'entities_body_text' => array('entities_body_text_example'), 
  'not_entities_body_text' => array('entities_body_text_example'), 
  'entities_body_type' => array('entities_body_type_example'), 
  'not_entities_body_type' => array('entities_body_type_example'), 
  'entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
  'not_entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
  'sentiment_title_polarity' => 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity' => 'sentiment_title_polarity_example', 
  'sentiment_body_polarity' => 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity' => 'sentiment_body_polarity_example', 
  'media_images_count_min' => 56, 
  'media_images_count_max' => 56, 
  'media_images_width_min' => 56, 
  'media_images_width_max' => 56, 
  'media_images_height_min' => 56, 
  'media_images_height_max' => 56, 
  'media_images_content_length_min' => 56, 
  'media_images_content_length_max' => 56, 
  'media_images_format' => array('media_images_format_example'), 
  'not_media_images_format' => array('media_images_format_example'), 
  'media_videos_count_min' => 56, 
  'media_videos_count_max' => 56, 
  'author_id' => array(56), 
  'not_author_id' => array(56), 
  'author_name' => 'author_name_example', 
  'not_author_name' => 'author_name_example', 
  'source_id' => array(56), 
  'not_source_id' => array(56), 
  'source_name' => array('source_name_example'), 
  'not_source_name' => array('source_name_example'), 
  'source_domain' => array('source_domain_example'), 
  'not_source_domain' => array('source_domain_example'), 
  'source_locations_country' => array('source_locations_country_example'), 
  'not_source_locations_country' => array('source_locations_country_example'), 
  'source_locations_state' => array('source_locations_state_example'), 
  'not_source_locations_state' => array('source_locations_state_example'), 
  'source_locations_city' => array('source_locations_city_example'), 
  'not_source_locations_city' => array('source_locations_city_example'), 
  'source_scopes_country' => array('source_scopes_country_example'), 
  'not_source_scopes_country' => array('source_scopes_country_example'), 
  'source_scopes_state' => array('source_scopes_state_example'), 
  'not_source_scopes_state' => array('source_scopes_state_example'), 
  'source_scopes_city' => array('source_scopes_city_example'), 
  'not_source_scopes_city' => array('source_scopes_city_example'), 
  'source_scopes_level' => array('source_scopes_level_example'), 
  'not_source_scopes_level' => array('source_scopes_level_example'), 
  'source_links_in_count_min' => 56, 
  'source_links_in_count_max' => 56, 
  'source_rankings_alexa_rank_min' => 56, 
  'source_rankings_alexa_rank_max' => 56, 
  'source_rankings_alexa_country' => array('source_rankings_alexa_country_example'), 
  'social_shares_count_facebook_min' => 56, 
  'social_shares_count_facebook_max' => 56, 
  'social_shares_count_GooglePlus_min' => 56, 
  'social_shares_count_GooglePlus_max' => 56, 
  'social_shares_count_Linkedin_min' => 56, 
  'social_shares_count_Linkedin_max' => 56, 
  'social_shares_count_Reddit_min' => 56, 
  'social_shares_count_Reddit_max' => 56, 
  'clusters' => array('clusters_example'), 
  'return' => array('title', 'published_at', 'source'), 
  'sort_by' =>  'source.rankings.alexa.rank', 
  'sort_direction' => 'asc', 
  'cursor' => '*', 
  'per_page' => 1
);  

try {
    $result = $apiInstance->listStories($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listStories: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require("aylien-news-api");
var defaultClient = AylienNewsApi.ApiClient.instance;

// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR_APP_ID';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_id.apiKeyPrefix = 'Token';
// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_key.apiKeyPrefix = 'Token';

var apiInstance = new AylienNewsApi.DefaultApi();

var opts = {
  'id': [null], 
  'notId': [null], 
  'title': "title_example", 
  'body': "body_example", 
  'text': "text_example", 
  'translationsEnTitle': "translationsEnTitle_example", 
  'translationsEnBody': "translationsEnBody_example", 
  'translationsEnText': "translationsEnText_example", 
  'language': ["null"], 
  'notLanguage': ["null"], 
  'publishedAtStart': "publishedAtStart_example", 
  'publishedAtEnd': "publishedAtEnd_example", 
  'categoriesTaxonomy': "categoriesTaxonomy_example", 
  'categoriesConfident': true, 
  'categoriesId': ["null"], 
  'notCategoriesId': ["null"], 
  'categoriesLevel': [null], 
  'notCategoriesLevel': [null], 
  'entitiesTitleText': ["null"], 
  'notEntitiesTitleText': ["null"], 
  'entitiesTitleType': ["null"], 
  'notEntitiesTitleType': ["null"], 
  'entitiesTitleLinksDbpedia': ["null"], 
  'notEntitiesTitleLinksDbpedia': ["null"], 
  'entitiesBodyText': ["null"], 
  'notEntitiesBodyText': ["null"], 
  'entitiesBodyType': ["null"], 
  'notEntitiesBodyType': ["null"], 
  'entitiesBodyLinksDbpedia': ["null"], 
  'notEntitiesBodyLinksDbpedia': ["null"], 
  'sentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'notSentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'sentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'notSentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'mediaImagesCountMin': 56, 
  'mediaImagesCountMax': 56, 
  'mediaImagesWidthMin': 56, 
  'mediaImagesWidthMax': 56, 
  'mediaImagesHeightMin': 56, 
  'mediaImagesHeightMax': 56, 
  'mediaImagesContentLengthMin': 56, 
  'mediaImagesContentLengthMax': 56, 
  'mediaImagesFormat': ["null"], 
  'notMediaImagesFormat': ["null"], 
  'mediaVideosCountMin': 56, 
  'mediaVideosCountMax': 56, 
  'authorId': [null], 
  'notAuthorId': [null], 
  'authorName': "authorName_example", 
  'notAuthorName': "authorName_example", 
  'sourceId': [null], 
  'notSourceId': [null], 
  'sourceName': ["null"], 
  'notSourceName': ["null"], 
  'sourceDomain': ["null"], 
  'notSourceDomain': ["null"], 
  'sourceLocationsCountry': ["null"], 
  'notSourceLocationsCountry': ["null"], 
  'sourceLocationsState': ["null"], 
  'notSourceLocationsState': ["null"], 
  'sourceLocationsCity': ["null"], 
  'notSourceLocationsCity': ["null"], 
  'sourceScopesCountry': ["null"], 
  'notSourceScopesCountry': ["null"], 
  'sourceScopesState': ["null"], 
  'notSourceScopesState': ["null"], 
  'sourceScopesCity': ["null"], 
  'notSourceScopesCity': ["null"], 
  'sourceScopesLevel': ["null"], 
  'notSourceScopesLevel': ["null"], 
  'sourceLinksInCountMin': 56, 
  'sourceLinksInCountMax': 56, 
  'sourceRankingsAlexaRankMin': 56, 
  'sourceRankingsAlexaRankMax': 56, 
  'sourceRankingsAlexaCountry': ["null"], 
  'socialSharesCountFacebookMin': 56, 
  'socialSharesCountFacebookMax': 56, 
  'socialSharesCountGooglePlusMin': 56, 
  'socialSharesCountGooglePlusMax': 56, 
  'socialSharesCountLinkedinMin': 56, 
  'socialSharesCountLinkedinMax': 56, 
  'socialSharesCountRedditMin': 56, 
  'socialSharesCountRedditMax': 56, 
  'clusters': ["clusters_example"], 
  '_return': ["_return_example"], 
  'sortBy': "sortBy_example" ,
  'sortDirection': "desc", 
  'cursor': "*", 
  'perPage': 10 
};

apiInstance.listStories(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.stories);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi

  storiesParams := &newsapi.ListStoriesOpts{
    Id:                             optional.NewInterface([]int64{123}),
    NotId:                          optional.NewInterface([]int64{123}),
    Title:                          optional.NewString("startup"),
    Body:                           optional.NewString("investment"),
    Text:                           optional.NewString("AI"),
    TranslationsEnTitle:            optional.NewString("Trump"),
    TranslationsEnBody:             optional.NewString("bank"),
    TranslationsEnText:             optional.NewString("sanctions"),
    Language:                       optional.NewInterface([]string{"en"}),
    NotLanguage:                    optional.NewInterface([]string{"zh-cn"}),
    PublishedAtStart:               optional.NewString("NOW-1MONTH"),
    PublishedAtEnd:                 optional.NewString("NOW-1DAY"),
    CategoriesTaxonomy:             optional.NewString("iptc-subjectcode"),
    CategoriesConfident:            optional.NewBool(true),
    CategoriesId:                   optional.NewInterface([]string{"04000000"}),
    NotCategoriesId:                optional.NewInterface([]string{"17000000"}),
    CategoriesLevel:                optional.NewInterface([]int32{1}),
    NotCategoriesLevel:             optional.NewInterface([]int32{2, 3}),
    EntitiesTitleText:              optional.NewInterface([]string{"Microsoft", "Apple"}),
    NotEntitiesTitleText:           optional.NewInterface([]string{"Amazon"}),
    EntitiesTitleType:              optional.NewInterface([]string{"Currency"}),
    NotEntitiesTitleType:           optional.NewInterface([]string{"Person"}),
    EntitiesTitleLinksDbpedia:      optional.NewInterface([]string{"http://dbpedia.org/resource/Linux"}),
    NotEntitiesTitleLinksDbpedia:   optional.NewInterface([]string{"http://dbpedia.org/resource/Windows"}),
    EntitiesBodyText:               optional.NewInterface([]string{"Raspberry Pi"}),
    NotEntitiesBodyText:            optional.NewInterface([]string{"Stephen"}),
    EntitiesBodyType:               optional.NewInterface([]string{"Index"}),
    NotEntitiesBodyType:            optional.NewInterface([]string{"Location"}),
    EntitiesBodyLinksDbpedia:       optional.NewInterface([]string{"http://dbpedia.org/resource/Ireland"}),
    NotEntitiesBodyLinksDbpedia:    optional.NewInterface([]string{"http://dbpedia.org/resource/London"}),
    SentimentTitlePolarity:         optional.NewString("positive"),
    NotSentimentTitlePolarity:      optional.NewString("negative"),
    SentimentBodyPolarity:          optional.NewString("positive"),
    NotSentimentBodyPolarity:       optional.NewString("neutral"),
    MediaImagesCountMin:            optional.NewInt32(1),
    MediaImagesCountMax:            optional.NewInt32(4),
    MediaImagesWidthMin:            optional.NewInt32(640),
    MediaImagesWidthMax:            optional.NewInt32(1200),
    MediaImagesHeightMin:           optional.NewInt32(700),
    MediaImagesHeightMax:           optional.NewInt32(1500),
    MediaImagesContentLengthMin:    optional.NewInt32(25000),
    MediaImagesContentLengthMax:    optional.NewInt32(40000),
    MediaImagesFormat:              optional.NewInterface([]string{"JPEG"}),
    NotMediaImagesFormat:           optional.NewInterface([]string{"PNG"}),
    MediaVideosCountMin:            optional.NewInt32(1),
    MediaVideosCountMax:            optional.NewInt32(2),
    AuthorId:                       optional.NewInterface([]int32{123}),
    NotAuthorId:                    optional.NewInterface([]int32{321}),
    AuthorName:                     optional.NewString("Charlie Kelly"),
    NotAuthorName:                  optional.NewString("Frank Reynolds"),
    SourceId:                       optional.NewInterface([]int32{123}),
    NotSourceId:                    optional.NewInterface([]int32{321}),
    SourceName:                     optional.NewInterface([]string{"The Irish Times"}),
    NotSourceName:                  optional.NewInterface([]string{"The Irish Independent"}),
    SourceDomain:                   optional.NewInterface([]string{"bbc.com"}),
    NotSourceDomain:                optional.NewInterface([]string{"cnn.com"}),
    SourceLocationsCountry:         optional.NewInterface([]string{"US"}),
    NotSourceLocationsCountry:      optional.NewInterface([]string{"GB"}),
    SourceLocationsState:           optional.NewInterface([]string{"Florida"}),
    NotSourceLocationsState:        optional.NewInterface([]string{"California"}),
    SourceLocationsCity:            optional.NewInterface([]string{"Miami"}),
    NotSourceLocationsCity:         optional.NewInterface([]string{"Austin"}),
    SourceScopesCountry:            optional.NewInterface([]string{"IE"}),
    NotSourceScopesCountry:         optional.NewInterface([]string{"DE"}),
    SourceScopesState:              optional.NewInterface([]string{"Illinois"}),
    NotSourceScopesState:           optional.NewInterface([]string{"Montana"}),
    SourceScopesCity:               optional.NewInterface([]string{"Sheboygan"}),
    NotSourceScopesCity:            optional.NewInterface([]string{"Westport"}),
    SourceScopesLevel:              optional.NewInterface([]string{"national"}),
    NotSourceScopesLevel:           optional.NewInterface([]string{"international"}),
    SourceLinksInCountMin:          optional.NewInt32(1),
    SourceLinksInCountMax:          optional.NewInt32(3000),
    SourceRankingsAlexaRankMin:     optional.NewInt32(1),
    SourceRankingsAlexaRankMax:     optional.NewInt32(1000),
    SourceRankingsAlexaCountry:     optional.NewInterface([]string{"US"}),
    SocialSharesCountFacebookMin:   optional.NewInt32(10),
    SocialSharesCountFacebookMax:   optional.NewInt32(1000),
    SocialSharesCountGooglePlusMin: optional.NewInt32(10),
    SocialSharesCountGooglePlusMax: optional.NewInt32(1000),
    SocialSharesCountLinkedinMin:   optional.NewInt32(10),
    SocialSharesCountLinkedinMax:   optional.NewInt32(1000),
    SocialSharesCountRedditMin:     optional.NewInt32(10),
    SocialSharesCountRedditMax:     optional.NewInt32(1000),
    Clusters:                       optional.NewInterface([]int32{1234567}),
    Return_:                        optional.NewInterface([]string{"title"}),
    SortBy:                         optional.NewString("published_at"),
    SortDirection:                  optional.NewString("desc"),
    Cursor:                         optional.NewString("*"),
    PerPage:                        optional.NewInt32(5),
  }

  storiesResponse, res, err := api.ListStories(context.Background(), storiesParams)

  if err != nil {
    panic(err)
  }

  _ = res

  for _, story := range storiesResponse.Stories {
    fmt.Println(story.PublishedAt, story.Title, " / ", story.Source.Name)
  }
}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    List<Long> id = Arrays.asList();  
    List<Long> notId = Arrays.asList();  
    String title = "Liverpool";  
    String body = "body_example";  
    String text = "text_example";  
    String translationsEnTitle = "translationsEnTitle_example";  
    String translationsEnBody = "translationsEnBody_example";  
    String translationsEnText = "translationsEnText_example";  
    List<String> language = Arrays.asList();  
    List<String> notLanguage = Arrays.asList();  
    String publishedAtStart = "publishedAtStart_example";  
    String publishedAtEnd = "publishedAtEnd_example";  
    String categoriesTaxonomy = "categoriesTaxonomy_example";  
    Boolean categoriesConfident = true;  
    List<String> categoriesId = Arrays.asList();  
    List<String> notCategoriesId = Arrays.asList();  
    List<Integer> categoriesLevel = Arrays.asList();  
    List<Integer> notCategoriesLevel = Arrays.asList();  
    List<String> entitiesTitleText = Arrays.asList();  
    List<String> notEntitiesTitleText = Arrays.asList();  
    List<String> entitiesTitleType = Arrays.asList();  
    List<String> notEntitiesTitleType = Arrays.asList();  
    List<String> entitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> entitiesBodyText = Arrays.asList();  
    List<String> notEntitiesBodyText = Arrays.asList();  
    List<String> entitiesBodyType = Arrays.asList();  
    List<String> notEntitiesBodyType = Arrays.asList();  
    List<String> entitiesBodyLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesBodyLinksDbpedia = Arrays.asList();  
    String sentimentTitlePolarity = "sentimentTitlePolarity_example";  
    String notSentimentTitlePolarity = "notSentimentTitlePolarity_example";  
    String sentimentBodyPolarity = "sentimentBodyPolarity_example";  
    String notSentimentBodyPolarity = "notSentimentBodyPolarity_example";  
    Integer mediaImagesCountMin = 56;  
    Integer mediaImagesCountMax = 56;  
    Integer mediaImagesWidthMin = 56;  
    Integer mediaImagesWidthMax = 56;  
    Integer mediaImagesHeightMin = 56;  
    Integer mediaImagesHeightMax = 56;  
    Integer mediaImagesContentLengthMin = 56;  
    Integer mediaImagesContentLengthMax = 56;  
    List<String> mediaImagesFormat = Arrays.asList();  
    List<String> notMediaImagesFormat = Arrays.asList();  
    Integer mediaVideosCountMin = 56;  
    Integer mediaVideosCountMax = 56;  
    List<Integer> authorId = Arrays.asList();  
    List<Integer> notAuthorId = Arrays.asList();  
    String authorName = "authorName_example";  
    String notAuthorName = "notAuthorName_example";  
    List<Integer> sourceId = Arrays.asList();  
    List<Integer> notSourceId = Arrays.asList();  
    List<String> sourceName = Arrays.asList();  
    List<String> notSourceName = Arrays.asList();  
    List<String> sourceDomain = Arrays.asList();  
    List<String> notSourceDomain = Arrays.asList();  
    List<String> sourceLocationsCountry = Arrays.asList();  
    List<String> notSourceLocationsCountry = Arrays.asList();  
    List<String> sourceLocationsState = Arrays.asList();  
    List<String> notSourceLocationsState = Arrays.asList();  
    List<String> sourceLocationsCity = Arrays.asList();  
    List<String> notSourceLocationsCity = Arrays.asList();  
    List<String> sourceScopesCountry = Arrays.asList();  
    List<String> notSourceScopesCountry = Arrays.asList();  
    List<String> sourceScopesState = Arrays.asList();  
    List<String> notSourceScopesState = Arrays.asList();  
    List<String> sourceScopesCity = Arrays.asList();  
    List<String> notSourceScopesCity = Arrays.asList();  
    List<String> sourceScopesLevel = Arrays.asList();  
    List<String> notSourceScopesLevel = Arrays.asList();  
    Integer sourceLinksInCountMin = 56;  
    Integer sourceLinksInCountMax = 56;  
    Integer sourceRankingsAlexaRankMin = 56;  
    Integer sourceRankingsAlexaRankMax = 56;  
    List<String> sourceRankingsAlexaCountry = Arrays.asList();  
    Integer socialSharesCountFacebookMin = 56;  
    Integer socialSharesCountFacebookMax = 56;  
    Integer socialSharesCountGooglePlusMin = 56;  
    Integer socialSharesCountGooglePlusMax = 56;  
    Integer socialSharesCountLinkedinMin = 56;  
    Integer socialSharesCountLinkedinMax = 56;  
    Integer socialSharesCountRedditMin = 56;  
    Integer socialSharesCountRedditMax = 56;  
    List<String> clusters = Arrays.asList();  
    List<String> _return = Arrays.asList();  
    String sortBy = "published_at";  
    String sortDirection = "desc";  
    String cursor = "\"*\"";  
    Integer perPage = 1;

    try {
      Stories result = apiInstance.listStories()
            .id(id)
            .notId(notId)
            .title(title)
            .body(body)
            .text(text)
            .translationsEnTitle(translationsEnTitle)
            .translationsEnBody(translationsEnBody)
            .translationsEnText(translationsEnText)
            .language(language)
            .notLanguage(notLanguage)
            .publishedAtStart(publishedAtStart)
            .publishedAtEnd(publishedAtEnd)
            .categoriesTaxonomy(categoriesTaxonomy)
            .categoriesConfident(categoriesConfident)
            .categoriesId(categoriesId)
            .notCategoriesId(notCategoriesId)
            .categoriesLevel(categoriesLevel)
            .notCategoriesLevel(notCategoriesLevel)
            .entitiesTitleText(entitiesTitleText)
            .notEntitiesTitleText(notEntitiesTitleText)
            .entitiesTitleType(entitiesTitleType)
            .notEntitiesTitleType(notEntitiesTitleType)
            .entitiesTitleLinksDbpedia(entitiesTitleLinksDbpedia)
            .notEntitiesTitleLinksDbpedia(notEntitiesTitleLinksDbpedia)
            .entitiesBodyText(entitiesBodyText)
            .notEntitiesBodyText(notEntitiesBodyText)
            .entitiesBodyType(entitiesBodyType)
            .notEntitiesBodyType(notEntitiesBodyType)
            .entitiesBodyLinksDbpedia(entitiesBodyLinksDbpedia)
            .notEntitiesBodyLinksDbpedia(notEntitiesBodyLinksDbpedia)
            .sentimentTitlePolarity(sentimentTitlePolarity)
            .notSentimentTitlePolarity(notSentimentTitlePolarity)
            .sentimentBodyPolarity(sentimentBodyPolarity)
            .notSentimentBodyPolarity(notSentimentBodyPolarity)
            .mediaImagesCountMin(mediaImagesCountMin)
            .mediaImagesCountMax(mediaImagesCountMax)
            .mediaImagesWidthMin(mediaImagesWidthMin)
            .mediaImagesWidthMax(mediaImagesWidthMax)
            .mediaImagesHeightMin(mediaImagesHeightMin)
            .mediaImagesHeightMax(mediaImagesHeightMax)
            .mediaImagesContentLengthMin(mediaImagesContentLengthMin)
            .mediaImagesContentLengthMax(mediaImagesContentLengthMax)
            .mediaImagesFormat(mediaImagesFormat)
            .notMediaImagesFormat(notMediaImagesFormat)
            .mediaVideosCountMin(mediaVideosCountMin)
            .mediaVideosCountMax(mediaVideosCountMax)
            .authorId(authorId)
            .notAuthorId(notAuthorId)
            .authorName(authorName)
            .notAuthorName(notAuthorName)
            .sourceId(sourceId)
            .notSourceId(notSourceId)
            .sourceName(sourceName)
            .notSourceName(notSourceName)
            .sourceDomain(sourceDomain)
            .notSourceDomain(notSourceDomain)
            .sourceLocationsCountry(sourceLocationsCountry)
            .notSourceLocationsCountry(notSourceLocationsCountry)
            .sourceLocationsState(sourceLocationsState)
            .notSourceLocationsState(notSourceLocationsState)
            .sourceLocationsCity(sourceLocationsCity)
            .notSourceLocationsCity(notSourceLocationsCity)
            .sourceScopesCountry(sourceScopesCountry)
            .notSourceScopesCountry(notSourceScopesCountry)
            .sourceScopesState(sourceScopesState)
            .notSourceScopesState(notSourceScopesState)
            .sourceScopesCity(sourceScopesCity)
            .notSourceScopesCity(notSourceScopesCity)
            .sourceScopesLevel(sourceScopesLevel)
            .notSourceScopesLevel(notSourceScopesLevel)
            .sourceLinksInCountMin(sourceLinksInCountMin)
            .sourceLinksInCountMax(sourceLinksInCountMax)
            .sourceRankingsAlexaRankMin(sourceRankingsAlexaRankMin)
            .sourceRankingsAlexaRankMax(sourceRankingsAlexaRankMax)
            .sourceRankingsAlexaCountry(sourceRankingsAlexaCountry)
            .socialSharesCountFacebookMin(socialSharesCountFacebookMin)
            .socialSharesCountFacebookMax(socialSharesCountFacebookMax)
            .socialSharesCountGooglePlusMin(socialSharesCountGooglePlusMin)
            .socialSharesCountGooglePlusMax(socialSharesCountGooglePlusMax)
            .socialSharesCountLinkedinMin(socialSharesCountLinkedinMin)
            .socialSharesCountLinkedinMax(socialSharesCountLinkedinMax)
            .socialSharesCountRedditMin(socialSharesCountRedditMin)
            .socialSharesCountRedditMax(socialSharesCountRedditMax)
            .clusters(clusters)
            ._return(_return)
            .sortBy(sortBy)
            .sortDirection(sortDirection)
            .cursor(cursor)
            .perPage(perPage)
            .execute();
      for (Iterator i = result.getStories().iterator(); i.hasNext();) {
        Story story = (Story)i.next();
        System.out.println(story);
      }
    } catch (ApiException e) {
      System.err.println(e.toString());
      e.printStackTrace();
    }
  }
}

Stories allows you to search for news articles based on a specific set of parameters that you set in your query, such as keywords, entities or sources. The News API gathers articles in near real-time, and stores and indexes them along with metadata and enrichments, which you can search over. Below you can see all of the query parameters which you can use to specify and narrow down your query.

HTTP Request

  • GET https://api.aylien.com/news/stories

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

global_clustering
integer
(query)

This parameter is used for enabling the clustering functionality. Setting the value to 1 enables clustering, 0 disables the functionality. Defaults to 0. Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

clusters[]
array [integer]
(query)

This parameter is used for filtering stories associated with a specific cluster (currently accepts one cluster per search). Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

!clusters[]
array [integer]
(query)

This parameter is used for blocking stories associated with a specific cluster (currently accepts one cluster per search). Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

translations.en.title
string
(query)

This parameter is used for filtering stories translated from a non-English language containing an English-language query term in the title. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

translations.en.body
string
(query)

This parameter is used for filtering stories translated from a non-English language containing an English-language query term in the body. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

id[]
array [integer]
(query)

This parameter is used for finding stories by story id.

!id[]
array [integer]
(query)

This parameter is used for excluding stories by story id.

title
string
(query)

This parameter is used for finding stories whose title contains a specific keyword. It supports boolean operators.

body
string
(query)

This parameter is used for finding stories whose body contains a specific keyword. It supports boolean operators.

text
string
(query)

This parameter is used for finding stories whose title or body contains a specific keyword. It supports boolean operators.

language[]
array [string]
(query)

This parameter is used for finding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

!language[]
array [string]
(query)

This parameter is used for excluding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

published_at.start
string
(query)

This parameter is used for finding stories whose published at time is greater than the specified value. Here you can find more information about how to work with dates.

published_at.end
string
(query)

This parameter is used for finding stories whose published at time is less than the specified value. Here you can find more information about how to work with dates.

categories.taxonomy
string
(query)

This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories here.

categories.confident
boolean
(query)

This parameter is used for finding stories whose categories are confident. You can read more about working with categories here.

Default value: true

categories.id[]
array [string]
(query)

This parameter is used for finding stories by categories id. You can read more about working with categories here, and find category ids here.

!categories.id[]
array [string]
(query)

This parameter is used for excluding stories by categories id. You can read more about working with categories here, and find category ids here.

categories.level[]
array [integer]
(query)

This parameter is used for finding stories by categories level. You can read more about working with categories here, and find category ids here.

!categories.level[]
array [integer]
(query)

This parameter is used for excluding stories by categories level. You can read more about working with categories here, and find category ids here.

entities.title.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in story titles. You can read more about working with entities here.

!entities.title.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in story titles. You can read more about working with entities here.

entities.title.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in story titles. You can read more about working with entities here.

!entities.title.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in story titles. You can read more about working with entities here.

entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

!entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

entities.body.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in the body of stories. You can read more about working with entities here.

!entities.body.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in the body of stories. You can read more about working with entities here.

entities.body.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in the body of stories. You can read more about working with entities here.

!entities.body.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in the body of stories. You can read more about working with entities here.

entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

!entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

sentiment.title.polarity
string
(query)

This parameter is used for finding stories whose title sentiment is the specified value.

!sentiment.title.polarity
string
(query)

This parameter is used for excluding stories whose title sentiment is the specified value.

sentiment.body.polarity
string
(query)

This parameter is used for finding stories whose body sentiment is the specified value.

!sentiment.body.polarity
string
(query)

This parameter is used for excluding stories whose body sentiment is the specified value.

media.images.count.min
integer
(query)

This parameter is used for finding stories whose number of images is greater than or equal to the specified value.

media.images.count.max
integer
(query)

This parameter is used for finding stories whose number of images is less than or equal to the specified value.

media.images.width.min
integer
(query)

This parameter is used for finding stories whose width of images are greater than or equal to the specified value.

media.images.width.max
integer
(query)

This parameter is used for finding stories whose width of images are less than or equal to the specified value.

media.images.height.min
integer
(query)

This parameter is used for finding stories whose height of images are greater than or equal to the specified value.

media.images.height.max
integer
(query)

This parameter is used for finding stories whose height of images are less than or equal to the specified value.

media.images.content_length.min
integer
(query)

This parameter is used for finding stories whose images content length are greater than or equal to the specified value.

media.images.content_length.max
integer
(query)

This parameter is used for finding stories whose images content length are less than or equal to the specified value.

media.images.format[]
array [string]
(query)

This parameter is used for finding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

!media.images.format[]
array [string]
(query)

This parameter is used for excluding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

media.videos.count.min
integer
(query)

This parameter is used for finding stories whose number of videos is greater than or equal to the specified value.

media.videos.count.max
integer
(query)

This parameter is used for finding stories whose number of videos is less than or equal to the specified value.

author.id[]
array [integer]
(query)

This parameter is used for finding stories whose author id is the specified value.

!author.id[]
array [integer]
(query)

This parameter is used for excluding stories whose author id is the specified value.

author.name
string
(query)

This parameter is used for finding stories whose author full name contains the specified value.

!author.name
string
(query)

This parameter is used for excluding stories whose author full name contains the specified value.

source.id[]
array [integer]
(query)

This parameter is used for finding stories whose source id is the specified value.

!source.id[]
array [integer]
(query)

This parameter is used for excluding stories whose source id is the specified value.

source.name[]
array [string]
(query)

This parameter is used for finding stories whose source name contains the specified value.

!source.name[]
array [string]
(query)

This parameter is used for excluding stories whose source name contains the specified value.

source.domain[]
array [string]
(query)

This parameter is used for finding stories whose source domain is the specified value.

!source.domain[]
array [string]
(query)

This parameter is used for excluding stories whose source domain is the specified value.

source.locations.country[]
array [string]
(query)

This parameter is used for finding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.locations.country[]
array [string]
(query)

This parameter is used for excluding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.locations.state[]
array [string]
(query)

This parameter is used for finding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

!source.locations.state[]
array [string]
(query)

This parameter is used for excluding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

source.locations.city[]
array [string]
(query)

This parameter is used for finding stories whose source city is the specified value. Here you can find more information about how to work with locations.

!source.locations.city[]
array [string]
(query)

This parameter is used for excluding stories whose source city is the specified value. Here you can find more information about how to work with locations.

source.scopes.country[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.scopes.country[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.scopes.state[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

!source.scopes.state[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

source.scopes.city[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

!source.scopes.city[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

source.scopes.level[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

!source.scopes.level[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

source.links_in_count.min
integer
(query)

This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count here.

source.links_in_count.max
integer
(query)

This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count here.

source.rankings.alexa.rank.min
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.rank.max
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.country[]
array [string]
(query)

This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports ISO 3166-1 alpha-2 country codes. You can read more about working with Alexa ranks here.

social_shares_count.facebook.min
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value.

social_shares_count.facebook.max
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value.

social_shares_count.google_plus.min
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value.

social_shares_count.google_plus.max
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value.

social_shares_count.linkedin.min
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value.

social_shares_count.linkedin.max
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value.

social_shares_count.reddit.min
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value.

social_shares_count.reddit.max
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value.

cluster
boolean
(query)

This parameter enables clustering for the returned stories. You can read more about working with clustering here.

Default value: false

cluster.algorithm
string
(query)

This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and k-means algorithms. You can read more about working with clustering here.

Default value: lingo

return[]
array [string]
(query)

This parameter is used for specifying return fields.

Available values: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links

sort_by
string
(query)

This parameter is used for changing the order column of the results. You can read about sorting results here.

Default value: published_at

sort_direction
string
(query)

This parameter is used for changing the order direction of the result. You can read about sorting results here.

Default value: desc

cursor
string
(query)

This parameter is used for finding a specific page. You can read more about pagination of results here.

Default value: *

per_page
integer
(query)

This parameter is used for specifying number of items in each page You can read more about pagination of results here

Default value: 10

Response

Code Description
200

An object including an array of stories

401

Unauthorized

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

  • X-RateLimit-Limit: The number of allowed requests in the current period.
  • X-RateLimit-Remaining: The number of remaining requests in the current period.
  • X-RateLimit-Reset: The remaining window before the rate limit resets in UTC epoch seconds.
500

Internal Server Error

Related Stories

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'

# Defining host is optional and default to https://api.aylien.com/news
configuration.host = "https://api.aylien.com/news"
# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
  'id': [56], 
  'not_id': [56], 
  'title': 'title_example', 
  'body': 'body_example', 
  'text': 'text_example', 
  'translations_en_title': 'translations_en_title_example', 
  'translations_en_body': 'translations_en_body_example', 
  'translations_en_text': 'translations_en_text_example', 
  'language': ['language_example'], 
  'not_language': ['language_example'], 
  'published_at_start': 'published_at_start_example', 
  'published_at_end': 'published_at_end_example', 
  'categories_taxonomy': 'categories_taxonomy_example', 
  'categories_confident': True, 
  'categories_id': ['categories_id_example'], 
  'not_categories_id': ['categories_id_example'], 
  'categories_level': [56], 
  'not_categories_level': [56], 
  'entities_title_text': ['entities_title_text_example'], 
  'not_entities_title_text': ['entities_title_text_example'], 
  'entities_title_type': ['entities_title_type_example'], 
  'not_entities_title_type': ['entities_title_type_example'], 
  'entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'not_entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'entities_body_text': ['entities_body_text_example'], 
  'not_entities_body_text': ['entities_body_text_example'], 
  'entities_body_type': ['entities_body_type_example'], 
  'not_entities_body_type': ['entities_body_type_example'], 
  'entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'not_entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'media_images_count_min': 56, 
  'media_images_count_max': 56, 
  'media_images_width_min': 56, 
  'media_images_width_max': 56, 
  'media_images_height_min': 56, 
  'media_images_height_max': 56, 
  'media_images_content_length_min': 56, 
  'media_images_content_length_max': 56, 
  'media_images_format': ['media_images_format_example'], 
  'not_media_images_format': ['media_images_format_example'], 
  'media_videos_count_min': 56, 
  'media_videos_count_max': 56, 
  'author_id': [56], 
  'not_author_id': [56], 
  'author_name': 'author_name_example', 
  'not_author_name': 'author_name_example', 
  'source_id': [56], 
  'not_source_id': [56], 
  'source_name': ['source_name_example'], 
  'not_source_name': ['source_name_example'], 
  'source_domain': ['source_domain_example'], 
  'not_source_domain': ['source_domain_example'], 
  'source_locations_country': ['source_locations_country_example'], 
  'not_source_locations_country': ['source_locations_country_example'], 
  'source_locations_state': ['source_locations_state_example'], 
  'not_source_locations_state': ['source_locations_state_example'], 
  'source_locations_city': ['source_locations_city_example'], 
  'not_source_locations_city': ['source_locations_city_example'], 
  'source_scopes_country': ['source_scopes_country_example'], 
  'not_source_scopes_country': ['source_scopes_country_example'], 
  'source_scopes_state': ['source_scopes_state_example'], 
  'not_source_scopes_state': ['source_scopes_state_example'], 
  'source_scopes_city': ['source_scopes_city_example'], 
  'not_source_scopes_city': ['source_scopes_city_example'], 
  'source_scopes_level': ['source_scopes_level_example'], 
  'not_source_scopes_level': ['source_scopes_level_example'], 
  'source_links_in_count_min': 56, 
  'source_links_in_count_max': 56, 
  'source_rankings_alexa_rank_min': 56, 
  'source_rankings_alexa_rank_max': 56, 
  'source_rankings_alexa_country': ['source_rankings_alexa_country_example'], 
  'social_shares_count_facebook_min': 56, 
  'social_shares_count_facebook_max': 56, 
  'social_shares_count_google_plus_min': 56, 
  'social_shares_count_google_plus_max': 56, 
  'social_shares_count_linkedin_min': 56, 
  'social_shares_count_linkedin_max': 56, 
  'social_shares_count_reddit_min': 56, 
  'social_shares_count_reddit_max': 56, 
  'clusters': ['clusters_example'], 
  '_return': ['_return_example'], 
  'story_id': 56, 
  'story_url': 'story_url_example', 
  'story_title': 'story_title_example', 
  'story_body': 'story_body_example', 
  'boost_by': 'boost_by_example', 
  'story_language': 'auto', 
  'per_page': 3 
}

try:
    # List related stories
    api_response = api_instance.list_related_stories(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_related_stories: %s\n" % e)
# load the gem
require 'aylien_news_api'
require 'pp'
# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = "YOUR APP ID"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = "YOUR APP KEY"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new

opts = {
  :id => [5411],
  :not_id => [3625],
  :title => "startup AND (raise OR raised OR raising OR raises)",
  :body => "startup",
  :text => "startup company",
  :language => ["en", "fr"],
  :not_language => ["es", "it"],
  :published_at_start => "NOW-10DAYS",
  :published_at_end => "NOW",
  :categories_taxonomy => "iptc-subjectcode",
  :categories_confident => true,
  :categories_id => ["11000000", "02000000"],
  :not_categories_id => ["11001000", "10000000"],
  :categories_level => [3],
  :not_categories_level => [1, 2],
  :entities_title_text => ["GNU/Linux", "Microsoft"],
  :not_entities_title_text => ["Google", "Windows"],
  :entities_title_type => ["Software", "Organization"],
  :not_entities_title_type => ["Agent", "Person"],
  :entities_title_links_dbpedia => ["http =>//dbpedia.org/resource/Linux"],
  :not_entities_title_links_dbpedia => ["http =>//dbpedia.org/resource/Windows"],
  :entities_body_text => ["Free Software", "Open Source"],
  :not_entities_body_text => ["Barack Obama", "Trump"],
  :entities_body_type => ["Software", "Organization"],
  :not_entities_body_type => ["Agent", "Person"],
  :entities_body_links_dbpedia => ["http =>//dbpedia.org/resource/Linux"],
  :not_entities_body_links_dbpedia => ["http =>//dbpedia.org/resource/Windows"],
  :sentiment_title_polarity => "positive",
  :not_sentiment_title_polarity => "neutral",
  :sentiment_body_polarity => "negative",
  :not_sentiment_body_polarity => "positive",
  :media_images_count_min => 3,
  :media_images_count_max => 3,
  :media_images_width_min => 640,
  :media_images_width_max => 1024,
  :media_images_height_min => 480,
  :media_images_height_max => 800,
  :media_images_content_length_min => 25411,
  :media_images_content_length_max => 369541,
  :media_images_format => ["JPEG", "BMP", "GIF"],
  :not_media_images_format => ["TIFF", "PNG"],
  :media_videos_count_min => 1,
  :media_videos_count_max => 2,
  :author_id => [4155],
  :not_author_id => [2541],
  :author_name => "John Doe",
  :not_author_name => "Mike Wally",
  :source_id => [124],
  :not_source_id => [54],
  :source_name => ["BBC"],
  :not_source_name => ["Fox News"],
  :source_domain => ["bbc.co.uk"],
  :not_source_domain => ["foxnews.com"],
  :source_locations_country => ["US", "IE"],
  :not_source_locations_country => ["JP", "GB"],
  :source_locations_state => ["California"],
  :not_source_locations_state => ["Arizona"],
  :source_locations_city => ["Los Angeles"],
  :not_source_locations_city => ["Dublin City"],
  :source_scopes_country => ["GB", "IE"],
  :not_source_scopes_country => ["US", "JP"],
  :source_scopes_state => ["Co Dublin"],
  :not_source_scopes_state => ["Co Wicklow"],
  :source_scopes_city => ["Cork"],
  :not_source_scopes_city => ["Galway"],
  :source_scopes_level => ["local"],
  :not_source_scopes_level => ["national"],
  :source_links_in_count_min => 126333,
  :source_links_in_count_max => 521000,
  :source_rankings_alexa_rank_min => 123,
  :source_rankings_alexa_rank_max => 152,
  :source_rankings_alexa_country => ["IE"],
  :social_shares_count_facebook_min => 3521,
  :social_shares_count_facebook_max => 5841,
  :social_shares_count_google_plus_min => 2541,
  :social_shares_count_google_plus_max => 36541,
  :social_shares_count_linkedin_min => 6521,
  :social_shares_count_linkedin_max => 32541,
  :social_shares_count_reddit_min => 14521,
  :social_shares_count_reddit_max => 95841,
  :_return => ["id", "title", "body", "published_at"],
  :story_id => 789,
  :story_url => "https =>//techcrunch.com/2016/04/07/aylien-launches-news-analysis-api-powered-by-its-deep-learning-tech/",
  :story_title => "Aylien launches news analysis API powered by its deep learning tech",
  :story_body => "Text analysis startup Aylien, which uses deep learning ...",
  :boost_by => "recency",
  :story_language => "auto",
  :per_page => 3
}


begin
  #List Stories
  result = api_instance.list_related_stories(opts)
  pp result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_relatedstories: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$opts = array(
    'id' => array(56), 
    'not_id' => array(56), 
    'title' => 'title_example', 
    'body' => 'body_example', 
    'text' => 'text_example', 
    'translations_en_title' => 'translations_en_title_example', 
    'translations_en_body' => 'translations_en_body_example', 
    'translations_en_text' => 'translations_en_text_example', 
    'language' => array('language_example'), 
    'not_language' => array('language_example'), 
    'published_at_start' => 'published_at_start_example', 
    'published_at_end' => 'published_at_end_example', 
    'categories_taxonomy' => 'categories_taxonomy_example', 
    'categories_confident' => true, 
    'categories_id' => array('categories_id_example'), 
    'not_categories_id' => array('categories_id_example'), 
    'categories_level' => array(56), 
    'not_categories_level' => array(56), 
    'entities_title_text' => array('entities_title_text_example'), 
    'not_entities_title_text' => array('entities_title_text_example'), 
    'entities_title_type' => array('entities_title_type_example'), 
    'not_entities_title_type' => array('entities_title_type_example'), 
    'entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
    'not_entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
    'entities_body_text' => array('entities_body_text_example'), 
    'not_entities_body_text' => array('entities_body_text_example'), 
    'entities_body_type' => array('entities_body_type_example'), 
    'not_entities_body_type' => array('entities_body_type_example'), 
    'entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
    'not_entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
    'sentiment_title_polarity' => 'sentiment_title_polarity_example', 
    'not_sentiment_title_polarity' => 'sentiment_title_polarity_example', 
    'sentiment_body_polarity' => 'sentiment_body_polarity_example', 
    'not_sentiment_body_polarity' => 'sentiment_body_polarity_example', 
    'media_images_count_min' => 56, 
    'media_images_count_max' => 56, 
    'media_images_width_min' => 56, 
    'media_images_width_max' => 56, 
    'media_images_height_min' => 56, 
    'media_images_height_max' => 56, 
    'media_images_content_length_min' => 56, 
    'media_images_content_length_max' => 56, 
    'media_images_format' => array('media_images_format_example'), 
    'not_media_images_format' => array('media_images_format_example'), 
    'media_videos_count_min' => 56, 
    'media_videos_count_max' => 56, 
    'author_id' => array(56), 
    'not_author_id' => array(56), 
    'author_name' => 'author_name_example', 
    'not_author_name' => 'author_name_example', 
    'source_id' => array(56), 
    'not_source_id' => array(56), 
    'source_name' => array('source_name_example'), 
    'not_source_name' => array('source_name_example'), 
    'source_domain' => array('source_domain_example'), 
    'not_source_domain' => array('source_domain_example'), 
    'source_locations_country' => array('source_locations_country_example'), 
    'not_source_locations_country' => array('source_locations_country_example'), 
    'source_locations_state' => array('source_locations_state_example'), 
    'not_source_locations_state' => array('source_locations_state_example'), 
    'source_locations_city' => array('source_locations_city_example'), 
    'not_source_locations_city' => array('source_locations_city_example'), 
    'source_scopes_country' => array('source_scopes_country_example'), 
    'not_source_scopes_country' => array('source_scopes_country_example'), 
    'source_scopes_state' => array('source_scopes_state_example'), 
    'not_source_scopes_state' => array('source_scopes_state_example'), 
    'source_scopes_city' => array('source_scopes_city_example'), 
    'not_source_scopes_city' => array('source_scopes_city_example'), 
    'source_scopes_level' => array('source_scopes_level_example'), 
    'not_source_scopes_level' => array('source_scopes_level_example'), 
    'source_links_in_count_min' => 56, 
    'source_links_in_count_max' => 56, 
    'source_rankings_alexa_rank_min' => 56, 
    'source_rankings_alexa_rank_max' => 56, 
    'source_rankings_alexa_country' => array('source_rankings_alexa_country_example'), 
    'social_shares_count_facebook_min' => 56, 
    'social_shares_count_facebook_max' => 56, 
    'social_shares_count_GooglePlus_min' => 56, 
    'social_shares_count_GooglePlus_max' => 56, 
    'social_shares_count_Linkedin_min' => 56, 
    'social_shares_count_Linkedin_max' => 56, 
    'social_shares_count_Reddit_min' => 56, 
    'social_shares_count_Reddit_max' => 56, 
    'clusters' => array('clusters_example'), 
    'return' => array('return_example'), 
    'story_id' => 56, 
    'story_url' => 'story_url_example', 
    'story_title' => 'story_title_example', 
    'story_body' => 'story_body_example', 
    'boost_by' => 'boost_by_example', 
    'story_language' => 'auto', 
    'per_page' => 3
);

try {
    $result = $apiInstance->listRelatedStories($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listRelatedStories: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require("aylien-news-api");
var defaultClient = AylienNewsApi.ApiClient.instance;
// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR APP ID';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_id.apiKeyPrefix = 'Token';
// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_key.apiKeyPrefix = 'Token';

var apiInstance = new AylienNewsApi.DefaultApi();
var opts = {
  'id': [null], 
  'notId': [null], 
  'title': "title_example", 
  'body': "body_example", 
  'text': "text_example", 
  'translationsEnTitle': "translationsEnTitle_example", 
  'translationsEnBody': "translationsEnBody_example", 
  'translationsEnText': "translationsEnText_example", 
  'language': ["null"], 
  'notLanguage': ["null"], 
  'publishedAtStart': "publishedAtStart_example", 
  'publishedAtEnd': "publishedAtEnd_example", 
  'categoriesTaxonomy': "categoriesTaxonomy_example", 
  'categoriesConfident': true, 
  'categoriesId': ["null"], 
  'notCategoriesId': ["null"], 
  'categoriesLevel': [null], 
  'notCategoriesLevel': [null], 
  'entitiesTitleText': ["null"], 
  'notEntitiesTitleText': ["null"], 
  'entitiesTitleType': ["null"], 
  'notEntitiesTitleType': ["null"], 
  'entitiesTitleLinksDbpedia': ["null"], 
  'notEntitiesTitleLinksDbpedia': ["null"], 
  'entitiesBodyText': ["null"], 
  'notEntitiesBodyText': ["null"], 
  'entitiesBodyType': ["null"], 
  'notEntitiesBodyType': ["null"], 
  'entitiesBodyLinksDbpedia': ["null"], 
  'notEntitiesBodyLinksDbpedia': ["null"], 
  'sentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'notSentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'sentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'notSentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'mediaImagesCountMin': 56, 
  'mediaImagesCountMax': 56, 
  'mediaImagesWidthMin': 56, 
  'mediaImagesWidthMax': 56, 
  'mediaImagesHeightMin': 56, 
  'mediaImagesHeightMax': 56, 
  'mediaImagesContentLengthMin': 56, 
  'mediaImagesContentLengthMax': 56, 
  'mediaImagesFormat': ["null"], 
  'notMediaImagesFormat': ["null"], 
  'mediaVideosCountMin': 56, 
  'mediaVideosCountMax': 56, 
  'authorId': [null], 
  'notAuthorId': [null], 
  'authorName': "authorName_example", 
  'notAuthorName': "authorName_example", 
  'sourceId': [null], 
  'notSourceId': [null], 
  'sourceName': ["null"], 
  'notSourceName': ["null"], 
  'sourceDomain': ["null"], 
  'notSourceDomain': ["null"], 
  'sourceLocationsCountry': ["null"], 
  'notSourceLocationsCountry': ["null"], 
  'sourceLocationsState': ["null"], 
  'notSourceLocationsState': ["null"], 
  'sourceLocationsCity': ["null"], 
  'notSourceLocationsCity': ["null"], 
  'sourceScopesCountry': ["null"], 
  'notSourceScopesCountry': ["null"], 
  'sourceScopesState': ["null"], 
  'notSourceScopesState': ["null"], 
  'sourceScopesCity': ["null"], 
  'notSourceScopesCity': ["null"], 
  'sourceScopesLevel': ["null"], 
  'notSourceScopesLevel': ["null"], 
  'sourceLinksInCountMin': 56, 
  'sourceLinksInCountMax': 56, 
  'sourceRankingsAlexaRankMin': 56, 
  'sourceRankingsAlexaRankMax': 56, 
  'sourceRankingsAlexaCountry': ["null"], 
  'socialSharesCountFacebookMin': 56, 
  'socialSharesCountFacebookMax': 56, 
  'socialSharesCountGooglePlusMin': 56, 
  'socialSharesCountGooglePlusMax': 56, 
  'socialSharesCountLinkedinMin': 56, 
  'socialSharesCountLinkedinMax': 56, 
  'socialSharesCountRedditMin': 56, 
  'socialSharesCountRedditMax': 56, 
  'clusters': ["null"], 
  '_return': ["return_example"], 
  'storyId': 789, 
  'storyUrl': "storyUrl_example", 
  'storyTitle': "storyTitle_example", 
  'storyBody': "storyBody_example", 
  'boostBy': "boostBy_example", 
  'storyLanguage': "auto", 
  'perPage': 3 
};

apiInstance.listRelatedStories(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.related_stories);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi

  relatedStoriesParams := &newsapi.ListRelatedStoriesOpts{
    Id:                             optional.NewInterface([]int64{123}),
    NotId:                          optional.NewInterface([]int64{123}),
    Title:                          optional.NewString("startup"),
    Body:                           optional.NewString("investment"),
    Text:                           optional.NewString("AI"),
    TranslationsEnTitle:            optional.NewString("Trump"),
    TranslationsEnBody:             optional.NewString("bank"),
    TranslationsEnText:             optional.NewString("sanctions"),
    Language:                       optional.NewInterface([]string{"en"}),
    NotLanguage:                    optional.NewInterface([]string{"zh-cn"}),
    PublishedAtStart:               optional.NewString("NOW-1MONTH"),
    PublishedAtEnd:                 optional.NewString("NOW-1DAY"),
    CategoriesTaxonomy:             optional.NewString("iptc-subjectcode"),
    CategoriesConfident:            optional.NewBool(true),
    CategoriesId:                   optional.NewInterface([]string{"04000000"}),
    NotCategoriesId:                optional.NewInterface([]string{"17000000"}),
    CategoriesLevel:                optional.NewInterface([]int32{1}),
    NotCategoriesLevel:             optional.NewInterface([]int32{2, 3}),
    EntitiesTitleText:              optional.NewInterface([]string{"Microsoft", "Apple"}),
    NotEntitiesTitleText:           optional.NewInterface([]string{"Amazon"}),
    EntitiesTitleType:              optional.NewInterface([]string{"Currency"}),
    NotEntitiesTitleType:           optional.NewInterface([]string{"Person"}),
    EntitiesTitleLinksDbpedia:      optional.NewInterface([]string{"http://dbpedia.org/resource/Linux"}),
    NotEntitiesTitleLinksDbpedia:   optional.NewInterface([]string{"http://dbpedia.org/resource/Windows"}),
    EntitiesBodyText:               optional.NewInterface([]string{"Raspberry Pi"}),
    NotEntitiesBodyText:            optional.NewInterface([]string{"Stephen"}),
    EntitiesBodyType:               optional.NewInterface([]string{"Index"}),
    NotEntitiesBodyType:            optional.NewInterface([]string{"Location"}),
    EntitiesBodyLinksDbpedia:       optional.NewInterface([]string{"http://dbpedia.org/resource/Ireland"}),
    NotEntitiesBodyLinksDbpedia:    optional.NewInterface([]string{"http://dbpedia.org/resource/London"}),
    SentimentTitlePolarity:         optional.NewString("positive"),
    NotSentimentTitlePolarity:      optional.NewString("negative"),
    SentimentBodyPolarity:          optional.NewString("positive"),
    NotSentimentBodyPolarity:       optional.NewString("neutral"),
    MediaImagesCountMin:            optional.NewInt32(1),
    MediaImagesCountMax:            optional.NewInt32(4),
    MediaImagesWidthMin:            optional.NewInt32(640),
    MediaImagesWidthMax:            optional.NewInt32(1200),
    MediaImagesHeightMin:           optional.NewInt32(700),
    MediaImagesHeightMax:           optional.NewInt32(1500),
    MediaImagesContentLengthMin:    optional.NewInt32(25000),
    MediaImagesContentLengthMax:    optional.NewInt32(40000),
    MediaImagesFormat:              optional.NewInterface([]string{"JPEG"}),
    NotMediaImagesFormat:           optional.NewInterface([]string{"PNG"}),
    MediaVideosCountMin:            optional.NewInt32(1),
    MediaVideosCountMax:            optional.NewInt32(2),
    AuthorId:                       optional.NewInterface([]int32{123}),
    NotAuthorId:                    optional.NewInterface([]int32{321}),
    AuthorName:                     optional.NewString("Charlie Kelly"),
    NotAuthorName:                  optional.NewString("Frank Reynolds"),
    SourceId:                       optional.NewInterface([]int32{123}),
    NotSourceId:                    optional.NewInterface([]int32{321}),
    SourceName:                     optional.NewInterface([]string{"The Irish Times"}),
    NotSourceName:                  optional.NewInterface([]string{"The Irish Independent"}),
    SourceDomain:                   optional.NewInterface([]string{"bbc.com"}),
    NotSourceDomain:                optional.NewInterface([]string{"cnn.com"}),
    SourceLocationsCountry:         optional.NewInterface([]string{"US"}),
    NotSourceLocationsCountry:      optional.NewInterface([]string{"GB"}),
    SourceLocationsState:           optional.NewInterface([]string{"Florida"}),
    NotSourceLocationsState:        optional.NewInterface([]string{"California"}),
    SourceLocationsCity:            optional.NewInterface([]string{"Miami"}),
    NotSourceLocationsCity:         optional.NewInterface([]string{"Austin"}),
    SourceScopesCountry:            optional.NewInterface([]string{"IE"}),
    NotSourceScopesCountry:         optional.NewInterface([]string{"DE"}),
    SourceScopesState:              optional.NewInterface([]string{"Illinois"}),
    NotSourceScopesState:           optional.NewInterface([]string{"Montana"}),
    SourceScopesCity:               optional.NewInterface([]string{"Sheboygan"}),
    NotSourceScopesCity:            optional.NewInterface([]string{"Westport"}),
    SourceScopesLevel:              optional.NewInterface([]string{"national"}),
    NotSourceScopesLevel:           optional.NewInterface([]string{"international"}),
    SourceLinksInCountMin:          optional.NewInt32(1),
    SourceLinksInCountMax:          optional.NewInt32(3000),
    SourceRankingsAlexaRankMin:     optional.NewInt32(1),
    SourceRankingsAlexaRankMax:     optional.NewInt32(1000),
    SourceRankingsAlexaCountry:     optional.NewInterface([]string{"US"}),
    SocialSharesCountFacebookMin:   optional.NewInt32(10),
    SocialSharesCountFacebookMax:   optional.NewInt32(1000),
    SocialSharesCountGooglePlusMin: optional.NewInt32(10),
    SocialSharesCountGooglePlusMax: optional.NewInt32(1000),
    SocialSharesCountLinkedinMin:   optional.NewInt32(10),
    SocialSharesCountLinkedinMax:   optional.NewInt32(1000),
    SocialSharesCountRedditMin:     optional.NewInt32(10),
    SocialSharesCountRedditMax:     optional.NewInt32(1000),
    Clusters:                       optional.NewInterface([]int32{1234567}),
    Return_:                        optional.NewInterface([]string{"title"}),
    PerPage:                        optional.NewInt32(5),
    StoryId:                        optional.NewInt64(123),
    StoryUrl:                       optional.NewString("https://techcrunch.com/2016/04/07/aylien-launches-news-analysis-api-powered-by-its-deep-learning-tech/"),
    StoryTitle:                     optional.NewString("Aylien launches news analysis API powered by its deep learning tech"),
    StoryBody:                      optional.NewString("Text analysis startup Aylien, which uses deep learning"),
    BoostBy:                        optional.NewString("popularity"),
    StoryLanguage:                  optional.NewString("auto"),
  }

  RelatedStoriesResponse, res, err := api.ListRelatedStories(context.Background(), relatedStoriesParams)

  if err != nil {
    panic(err)
  }

  _ = res

  for _, relatedStory := range RelatedStoriesResponse.RelatedStories{
    fmt.Println(relatedStory.PublishedAt, relatedStory.Title, " / ", relatedStory.Source.Name)
  }
}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    List<Long> id = Arrays.asList();  
    List<Long> notId = Arrays.asList();  
    String title = "title_example";  
    String body = "body_example";  
    String text = "text_example";  
    String translationsEnTitle = "translationsEnTitle_example";  
    String translationsEnBody = "translationsEnBody_example";  
    String translationsEnText = "translationsEnText_example";  
    List<String> language = Arrays.asList();  
    List<String> notLanguage = Arrays.asList();  
    String publishedAtStart = "publishedAtStart_example";  
    String publishedAtEnd = "publishedAtEnd_example";  
    String categoriesTaxonomy = "categoriesTaxonomy_example";  
    Boolean categoriesConfident = true;  
    List<String> categoriesId = Arrays.asList();  
    List<String> notCategoriesId = Arrays.asList();  
    List<Integer> categoriesLevel = Arrays.asList();  
    List<Integer> notCategoriesLevel = Arrays.asList();  
    List<String> entitiesTitleText = Arrays.asList();  
    List<String> notEntitiesTitleText = Arrays.asList();  
    List<String> entitiesTitleType = Arrays.asList();  
    List<String> notEntitiesTitleType = Arrays.asList();  
    List<String> entitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> entitiesBodyText = Arrays.asList();  
    List<String> notEntitiesBodyText = Arrays.asList();  
    List<String> entitiesBodyType = Arrays.asList();  
    List<String> notEntitiesBodyType = Arrays.asList();  
    List<String> entitiesBodyLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesBodyLinksDbpedia = Arrays.asList();  
    String sentimentTitlePolarity = "sentimentTitlePolarity_example";  
    String notSentimentTitlePolarity = "notSentimentTitlePolarity_example";  
    String sentimentBodyPolarity = "sentimentBodyPolarity_example";  
    String notSentimentBodyPolarity = "notSentimentBodyPolarity_example";  
    Integer mediaImagesCountMin = 56;  
    Integer mediaImagesCountMax = 56;  
    Integer mediaImagesWidthMin = 56;  
    Integer mediaImagesWidthMax = 56;  
    Integer mediaImagesHeightMin = 56;  
    Integer mediaImagesHeightMax = 56;  
    Integer mediaImagesContentLengthMin = 56;  
    Integer mediaImagesContentLengthMax = 56;  
    List<String> mediaImagesFormat = Arrays.asList();  
    List<String> notMediaImagesFormat = Arrays.asList();  
    Integer mediaVideosCountMin = 56;  
    Integer mediaVideosCountMax = 56;  
    List<Integer> authorId = Arrays.asList();  
    List<Integer> notAuthorId = Arrays.asList();  
    String authorName = "authorName_example";  
    String notAuthorName = "notAuthorName_example";  
    List<Integer> sourceId = Arrays.asList();  
    List<Integer> notSourceId = Arrays.asList();  
    List<String> sourceName = Arrays.asList();  
    List<String> notSourceName = Arrays.asList();  
    List<String> sourceDomain = Arrays.asList();  
    List<String> notSourceDomain = Arrays.asList();  
    List<String> sourceLocationsCountry = Arrays.asList();  
    List<String> notSourceLocationsCountry = Arrays.asList();  
    List<String> sourceLocationsState = Arrays.asList();  
    List<String> notSourceLocationsState = Arrays.asList();  
    List<String> sourceLocationsCity = Arrays.asList();  
    List<String> notSourceLocationsCity = Arrays.asList();  
    List<String> sourceScopesCountry = Arrays.asList();  
    List<String> notSourceScopesCountry = Arrays.asList();  
    List<String> sourceScopesState = Arrays.asList();  
    List<String> notSourceScopesState = Arrays.asList();  
    List<String> sourceScopesCity = Arrays.asList();  
    List<String> notSourceScopesCity = Arrays.asList();  
    List<String> sourceScopesLevel = Arrays.asList();  
    List<String> notSourceScopesLevel = Arrays.asList();  
    Integer sourceLinksInCountMin = 56;  
    Integer sourceLinksInCountMax = 56;  
    Integer sourceRankingsAlexaRankMin = 56;  
    Integer sourceRankingsAlexaRankMax = 56;  
    List<String> sourceRankingsAlexaCountry = Arrays.asList();  
    Integer socialSharesCountFacebookMin = 56;  
    Integer socialSharesCountFacebookMax = 56;  
    Integer socialSharesCountGooglePlusMin = 56;  
    Integer socialSharesCountGooglePlusMax = 56;  
    Integer socialSharesCountLinkedinMin = 56;  
    Integer socialSharesCountLinkedinMax = 56;  
    Integer socialSharesCountRedditMin = 56;  
    Integer socialSharesCountRedditMax = 56;  
    List<String> clusters = Arrays.asList();  
    List<String> _return = Arrays.asList();  
    Long storyId = 56L;  
    String storyUrl = "storyUrl_example";  
    String storyTitle = "storyTitle_example";  
    String storyBody = "storyBody_example";  
    String boostBy = "boostBy_example";  
    String storyLanguage = "auto";  
    Integer perPage = 3;  
  try {
      RelatedStories result = apiInstance.listRelatedStories()
            .id(id)
            .notId(notId)
            .title(title)
            .body(body)
            .text(text)
            .translationsEnTitle(translationsEnTitle)
            .translationsEnBody(translationsEnBody)
            .translationsEnText(translationsEnText)
            .language(language)
            .notLanguage(notLanguage)
            .publishedAtStart(publishedAtStart)
            .publishedAtEnd(publishedAtEnd)
            .categoriesTaxonomy(categoriesTaxonomy)
            .categoriesConfident(categoriesConfident)
            .categoriesId(categoriesId)
            .notCategoriesId(notCategoriesId)
            .categoriesLevel(categoriesLevel)
            .notCategoriesLevel(notCategoriesLevel)
            .entitiesTitleText(entitiesTitleText)
            .notEntitiesTitleText(notEntitiesTitleText)
            .entitiesTitleType(entitiesTitleType)
            .notEntitiesTitleType(notEntitiesTitleType)
            .entitiesTitleLinksDbpedia(entitiesTitleLinksDbpedia)
            .notEntitiesTitleLinksDbpedia(notEntitiesTitleLinksDbpedia)
            .entitiesBodyText(entitiesBodyText)
            .notEntitiesBodyText(notEntitiesBodyText)
            .entitiesBodyType(entitiesBodyType)
            .notEntitiesBodyType(notEntitiesBodyType)
            .entitiesBodyLinksDbpedia(entitiesBodyLinksDbpedia)
            .notEntitiesBodyLinksDbpedia(notEntitiesBodyLinksDbpedia)
            .sentimentTitlePolarity(sentimentTitlePolarity)
            .notSentimentTitlePolarity(notSentimentTitlePolarity)
            .sentimentBodyPolarity(sentimentBodyPolarity)
            .notSentimentBodyPolarity(notSentimentBodyPolarity)
            .mediaImagesCountMin(mediaImagesCountMin)
            .mediaImagesCountMax(mediaImagesCountMax)
            .mediaImagesWidthMin(mediaImagesWidthMin)
            .mediaImagesWidthMax(mediaImagesWidthMax)
            .mediaImagesHeightMin(mediaImagesHeightMin)
            .mediaImagesHeightMax(mediaImagesHeightMax)
            .mediaImagesContentLengthMin(mediaImagesContentLengthMin)
            .mediaImagesContentLengthMax(mediaImagesContentLengthMax)
            .mediaImagesFormat(mediaImagesFormat)
            .notMediaImagesFormat(notMediaImagesFormat)
            .mediaVideosCountMin(mediaVideosCountMin)
            .mediaVideosCountMax(mediaVideosCountMax)
            .authorId(authorId)
            .notAuthorId(notAuthorId)
            .authorName(authorName)
            .notAuthorName(notAuthorName)
            .sourceId(sourceId)
            .notSourceId(notSourceId)
            .sourceName(sourceName)
            .notSourceName(notSourceName)
            .sourceDomain(sourceDomain)
            .notSourceDomain(notSourceDomain)
            .sourceLocationsCountry(sourceLocationsCountry)
            .notSourceLocationsCountry(notSourceLocationsCountry)
            .sourceLocationsState(sourceLocationsState)
            .notSourceLocationsState(notSourceLocationsState)
            .sourceLocationsCity(sourceLocationsCity)
            .notSourceLocationsCity(notSourceLocationsCity)
            .sourceScopesCountry(sourceScopesCountry)
            .notSourceScopesCountry(notSourceScopesCountry)
            .sourceScopesState(sourceScopesState)
            .notSourceScopesState(notSourceScopesState)
            .sourceScopesCity(sourceScopesCity)
            .notSourceScopesCity(notSourceScopesCity)
            .sourceScopesLevel(sourceScopesLevel)
            .notSourceScopesLevel(notSourceScopesLevel)
            .sourceLinksInCountMin(sourceLinksInCountMin)
            .sourceLinksInCountMax(sourceLinksInCountMax)
            .sourceRankingsAlexaRankMin(sourceRankingsAlexaRankMin)
            .sourceRankingsAlexaRankMax(sourceRankingsAlexaRankMax)
            .sourceRankingsAlexaCountry(sourceRankingsAlexaCountry)
            .socialSharesCountFacebookMin(socialSharesCountFacebookMin)
            .socialSharesCountFacebookMax(socialSharesCountFacebookMax)
            .socialSharesCountGooglePlusMin(socialSharesCountGooglePlusMin)
            .socialSharesCountGooglePlusMax(socialSharesCountGooglePlusMax)
            .socialSharesCountLinkedinMin(socialSharesCountLinkedinMin)
            .socialSharesCountLinkedinMax(socialSharesCountLinkedinMax)
            .socialSharesCountRedditMin(socialSharesCountRedditMin)
            .socialSharesCountRedditMax(socialSharesCountRedditMax)
            .clusters(clusters)
            ._return(_return)
            .storyId(storyId)
            .storyUrl(storyUrl)
            .storyTitle(storyTitle)
            .storyBody(storyBody)
            .boostBy(boostBy)
            .storyLanguage(storyLanguage)
            .perPage(perPage)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#listRelatedStories");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Related Stories returns semantically similar stories for an input article, or any free-form text. For example, if you want to find stories similar to a tweet, you can supply the text of the tweet, and Related Stories will analyze it to extract topics and entities from it, and find stories with similar topical distribution and entities. You can use the standard filtering options to set additional filters, for example to retrieve stories that are related to an input story, but from a particular source, or with a particular sentiment.

HTTP Request

  • GET https://api.aylien.com/news/related_stories
  • POST https://api.aylien.com/news/related_stories

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

global_clustering
integer
(query)

This parameter is used for enabling the clustering functionality. Setting the value to 1 enables clustering, 0 disables the functionality. Defaults to 0. Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

clusters[]
array [integer]
(query)

This parameter is used for finding stories associated with a specific cluster (currently accepts one cluster per search).

translations.{language}.title
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the title. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

translations.{language}.body
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the body. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

id[]
array [integer]
(query)

This parameter is used for finding stories by story id.

!id[]
array [integer]
(query)

This parameter is used for excluding stories by story id.

title
string
(query)

This parameter is used for finding stories whose title contains a specific keyword. It supports boolean operators.

body
string
(query)

This parameter is used for finding stories whose body contains a specific keyword. It supports boolean operators.

text
string
(query)

This parameter is used for finding stories whose title or body contains a specific keyword. It supports boolean operators.

language[]
array [string]
(query)

This parameter is used for finding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

!language[]
array [string]
(query)

This parameter is used for excluding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

published_at.start
string
(query)

This parameter is used for finding stories whose published at time is greater than the specified value. Here you can find more information about how to work with dates.

published_at.end
string
(query)

This parameter is used for finding stories whose published at time is less than the specified value. Here you can find more information about how to work with dates.

categories.taxonomy
string
(query)

This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories here.

categories.confident
boolean
(query)

This parameter is used for finding stories whose categories are confident. You can read more about working with categories here.

Default value: true

categories.id[]
array [string]
(query)

This parameter is used for finding stories by categories id. You can read more about working with categories here, and find category ids here.

!categories.id[]
array [string]
(query)

This parameter is used for excluding stories by categories id. You can read more about working with categories here, and find category ids here.

categories.level[]
array [integer]
(query)

This parameter is used for finding stories by categories level. You can read more about working with categories here, and find category ids here.

!categories.level[]
array [integer]
(query)

This parameter is used for excluding stories by categories level. You can read more about working with categories here, and find category ids here.

entities.title.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in story titles. You can read more about working with entities here.

!entities.title.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in story titles. You can read more about working with entities here.

entities.title.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in story titles. You can read more about working with entities here.

!entities.title.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in story titles. You can read more about working with entities here.

entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

!entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

entities.body.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in the body of stories. You can read more about working with entities here.

!entities.body.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in the body of stories. You can read more about working with entities here.

entities.body.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in the body of stories. You can read more about working with entities here.

!entities.body.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in the body of stories. You can read more about working with entities here.

entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

!entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

sentiment.title.polarity
string
(query)

This parameter is used for finding stories whose title sentiment is the specified value.

!sentiment.title.polarity
string
(query)

This parameter is used for excluding stories whose title sentiment is the specified value.

sentiment.body.polarity
string
(query)

This parameter is used for finding stories whose body sentiment is the specified value.

!sentiment.body.polarity
string
(query)

This parameter is used for excluding stories whose body sentiment is the specified value.

media.images.count.min
integer
(query)

This parameter is used for finding stories whose number of images is greater than or equal to the specified value.

media.images.count.max
integer
(query)

This parameter is used for finding stories whose number of images is less than or equal to the specified value.

media.images.width.min
integer
(query)

This parameter is used for finding stories whose width of images are greater than or equal to the specified value.

media.images.width.max
integer
(query)

This parameter is used for finding stories whose width of images are less than or equal to the specified value.

media.images.height.min
integer
(query)

This parameter is used for finding stories whose height of images are greater than or equal to the specified value.

media.images.height.max
integer
(query)

This parameter is used for finding stories whose height of images are less than or equal to the specified value.

media.images.content_length.min
integer
(query)

This parameter is used for finding stories whose images content length are greater than or equal to the specified value.

media.images.content_length.max
integer
(query)

This parameter is used for finding stories whose images content length are less than or equal to the specified value.

media.images.format[]
array [string]
(query)

This parameter is used for finding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

!media.images.format[]
array [string]
(query)

This parameter is used for excluding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

media.videos.count.min
integer
(query)

This parameter is used for finding stories whose number of videos is greater than or equal to the specified value.

media.videos.count.max
integer
(query)

This parameter is used for finding stories whose number of videos is less than or equal to the specified value.

author.id[]
array [integer]
(query)

This parameter is used for finding stories whose author id is the specified value.

!author.id[]
array [integer]
(query)

This parameter is used for excluding stories whose author id is the specified value.

author.name
string
(query)

This parameter is used for finding stories whose author full name contains the specified value.

!author.name
string
(query)

This parameter is used for excluding stories whose author full name contains the specified value.

source.id[]
array [integer]
(query)

This parameter is used for finding stories whose source id is the specified value.

!source.id[]
array [integer]
(query)

This parameter is used for excluding stories whose source id is the specified value.

source.name[]
array [string]
(query)

This parameter is used for finding stories whose source name contains the specified value.

!source.name[]
array [string]
(query)

This parameter is used for excluding stories whose source name contains the specified value.

source.domain[]
array [string]
(query)

This parameter is used for finding stories whose source domain is the specified value.

!source.domain[]
array [string]
(query)

This parameter is used for excluding stories whose source domain is the specified value.

source.locations.country[]
array [string]
(query)

This parameter is used for finding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.locations.country[]
array [string]
(query)

This parameter is used for excluding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.locations.state[]
array [string]
(query)

This parameter is used for finding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

!source.locations.state[]
array [string]
(query)

This parameter is used for excluding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

source.locations.city[]
array [string]
(query)

This parameter is used for finding stories whose source city is the specified value. Here you can find more information about how to work with locations.

!source.locations.city[]
array [string]
(query)

This parameter is used for excluding stories whose source city is the specified value. Here you can find more information about how to work with locations.

source.scopes.country[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.scopes.country[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.scopes.state[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

!source.scopes.state[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

source.scopes.city[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

!source.scopes.city[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

source.scopes.level[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

!source.scopes.level[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

source.links_in_count.min
integer
(query)

This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count here.

source.links_in_count.max
integer
(query)

This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count here.

source.rankings.alexa.rank.min
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.rank.max
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.country[]
array [string]
(query)

This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports ISO 3166-1 alpha-2 country codes. You can read more about working with Alexa ranks here.

social_shares_count.facebook.min
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value.

social_shares_count.facebook.max
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value.

social_shares_count.google_plus.min
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value.

social_shares_count.google_plus.max
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value.

social_shares_count.linkedin.min
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value.

social_shares_count.linkedin.max
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value.

social_shares_count.reddit.min
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value.

social_shares_count.reddit.max
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value.

cluster
boolean
(query)

This parameter enables clustering for the returned stories. You can read more about working with clustering here.

Default value: false

cluster.algorithm
string
(query)

This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and k-means algorithms. You can read more about working with clustering here.

Default value: lingo

return[]
array [string]
(query)

This parameter is used for specifying return fields.

Available values: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links

story_id
integer
(query)

A story id

story_url
string
(query)

An article or webpage

story_title
string
(query)

Title of the article

story_body
string
(query)

Body of the article

boost_by
string
(query)

This parameter is used for boosting the result by the specified value.

story_language
string
(query)

This parameter is used for setting the language of the story. It supports ISO 639-1 language codes.

Default value: auto

per_page
integer
(query)

This parameter is used for specifying number of items in each page.

Default value: 3

Response

Code Description
200

An object including an array of related stories

401

Unauthorized

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

  • X-RateLimit-Limit: The number of allowed requests in the current period.
  • X-RateLimit-Remaining: The number of remaining requests in the current period.
  • X-RateLimit-Reset: The remaining window before the rate limit resets in UTC epoch seconds.
500

Internal Server Error

Coverages

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'

# Defining host is optional and default to https://api.aylien.com/news
configuration.host = "https://api.aylien.com/news"
# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
  'id': [56], 
  'not_id': [56], 
  'title': 'title_example', 
  'body': 'body_example', 
  'text': 'text_example', 
  'translations_en_title': 'translations_en_title_example', 
  'translations_en_body': 'translations_en_body_example', 
  'translations_en_text': 'translations_en_text_example', 
  'language': ['language_example'], 
  'not_language': ['language_example'], 
  'published_at_start': 'published_at_start_example', 
  'published_at_end': 'published_at_end_example', 
  'categories_taxonomy': 'categories_taxonomy_example', 
  'categories_confident': True, 
  'categories_id': ['categories_id_example'], 
  'not_categories_id': ['categories_id_example'], 
  'categories_level': [56], 
  'not_categories_level': [56], 
  'entities_title_text': ['entities_title_text_example'], 
  'not_entities_title_text': ['entities_title_text_example'], 
  'entities_title_type': ['entities_title_type_example'], 
  'not_entities_title_type': ['entities_title_type_example'], 
  'entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'not_entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'entities_body_text': ['entities_body_text_example'], 
  'not_entities_body_text': ['entities_body_text_example'], 
  'entities_body_type': ['entities_body_type_example'], 
  'not_entities_body_type': ['entities_body_type_example'], 
  'entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'not_entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'media_images_count_min': 56, 
  'media_images_count_max': 56, 
  'media_images_width_min': 56, 
  'media_images_width_max': 56, 
  'media_images_height_min': 56, 
  'media_images_height_max': 56, 
  'media_images_content_length_min': 56, 
  'media_images_content_length_max': 56, 
  'media_images_format': ['media_images_format_example'], 
  'not_media_images_format': ['media_images_format_example'], 
  'media_videos_count_min': 56, 
  'media_videos_count_max': 56, 
  'author_id': [56], 
  'not_author_id': [56], 
  'author_name': 'author_name_example', 
  'not_author_name': 'author_name_example', 
  'source_id': [56], 
  'not_source_id': [56], 
  'source_name': ['source_name_example'], 
  'not_source_name': ['source_name_example'], 
  'source_domain': ['source_domain_example'], 
  'not_source_domain': ['source_domain_example'], 
  'source_locations_country': ['source_locations_country_example'], 
  'not_source_locations_country': ['source_locations_country_example'], 
  'source_locations_state': ['source_locations_state_example'], 
  'not_source_locations_state': ['source_locations_state_example'], 
  'source_locations_city': ['source_locations_city_example'], 
  'not_source_locations_city': ['source_locations_city_example'], 
  'source_scopes_country': ['source_scopes_country_example'], 
  'not_source_scopes_country': ['source_scopes_country_example'], 
  'source_scopes_state': ['source_scopes_state_example'], 
  'not_source_scopes_state': ['source_scopes_state_example'], 
  'source_scopes_city': ['source_scopes_city_example'], 
  'not_source_scopes_city': ['source_scopes_city_example'], 
  'source_scopes_level': ['source_scopes_level_example'], 
  'not_source_scopes_level': ['source_scopes_level_example'], 
  'source_links_in_count_min': 56, 
  'source_links_in_count_max': 56, 
  'source_rankings_alexa_rank_min': 56, 
  'source_rankings_alexa_rank_max': 56, 
  'source_rankings_alexa_country': ['source_rankings_alexa_country_example'], 
  'social_shares_count_facebook_min': 56, 
  'social_shares_count_facebook_max': 56, 
  'social_shares_count_google_plus_min': 56, 
  'social_shares_count_google_plus_max': 56, 
  'social_shares_count_linkedin_min': 56, 
  'social_shares_count_linkedin_max': 56, 
  'social_shares_count_reddit_min': 56, 
  'social_shares_count_reddit_max': 56, 
  'clusters': ['clusters_example'], 
  '_return': ['_return_example'], 
  'story_id': 56, 
  'story_url': 'story_url_example', 
  'story_title': 'story_title_example', 
  'story_body': 'story_body_example', 
  'story_published_at': '2013-10-20T19:20:30+01:00', 
  'story_language': 'auto', 
  'per_page': 3 
}
try:
    # List coverages
    api_response = api_instance.list_coverages(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_coverages: %s\n" % e)
# load the gem
require 'aylien_news_api'
require 'pp'
# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = "YOUR APP ID"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = "YOUR APP KEY"
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new
opts = {
  :id => [56], 
  :not_id => [56], 
  :title => 'title_example', 
  :body => 'body_example', 
  :text => 'text_example', 
  :translations_en_title => 'translations_en_title_example', 
  :translations_en_body => 'translations_en_body_example', 
  :translations_en_text => 'translations_en_text_example', 
  :language => ['language_example'], 
  :not_language => ['language_example'], 
  :published_at_start => 'published_at_start_example', 
  :published_at_end => 'published_at_end_example', 
  :categories_taxonomy => 'categories_taxonomy_example', 
  :categories_confident => true, 
  :categories_id => ['categories_id_example'], 
  :not_categories_id => ['categories_id_example'], 
  :categories_level => [56], 
  :not_categories_level => [56], 
  :entities_title_text => ['entities_title_text_example'], 
  :not_entities_title_text => ['entities_title_text_example'], 
  :entities_title_type => ['entities_title_type_example'], 
  :not_entities_title_type => ['entities_title_type_example'], 
  :entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :not_entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :entities_body_text => ['entities_body_text_example'], 
  :not_entities_body_text => ['entities_body_text_example'], 
  :entities_body_type => ['entities_body_type_example'], 
  :not_entities_body_type => ['entities_body_type_example'], 
  :entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :not_entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :not_sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :not_sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :media_images_count_min => 56, 
  :media_images_count_max => 56, 
  :media_images_width_min => 56, 
  :media_images_width_max => 56, 
  :media_images_height_min => 56, 
  :media_images_height_max => 56, 
  :media_images_content_length_min => 56, 
  :media_images_content_length_max => 56, 
  :media_images_format => ['media_images_format_example'], 
  :not_media_images_format => ['media_images_format_example'], 
  :media_videos_count_min => 56, 
  :media_videos_count_max => 56, 
  :author_id => [56], 
  :not_author_id => [56], 
  :author_name => 'author_name_example', 
  :not_author_name => 'author_name_example', 
  :source_id => [56], 
  :not_source_id => [56], 
  :source_name => ['source_name_example'], 
  :not_source_name => ['source_name_example'], 
  :source_domain => ['source_domain_example'], 
  :not_source_domain => ['source_domain_example'], 
  :source_locations_country => ['source_locations_country_example'], 
  :not_source_locations_country => ['source_locations_country_example'], 
  :source_locations_state => ['source_locations_state_example'], 
  :not_source_locations_state => ['source_locations_state_example'], 
  :source_locations_city => ['source_locations_city_example'], 
  :not_source_locations_city => ['source_locations_city_example'], 
  :source_scopes_country => ['source_scopes_country_example'], 
  :not_source_scopes_country => ['source_scopes_country_example'], 
  :source_scopes_state => ['source_scopes_state_example'], 
  :not_source_scopes_state => ['source_scopes_state_example'], 
  :source_scopes_city => ['source_scopes_city_example'], 
  :not_source_scopes_city => ['source_scopes_city_example'], 
  :source_scopes_level => ['source_scopes_level_example'], 
  :not_source_scopes_level => ['source_scopes_level_example'], 
  :source_links_in_count_min => 56, 
  :source_links_in_count_max => 56, 
  :source_rankings_alexa_rank_min => 56, 
  :source_rankings_alexa_rank_max => 56, 
  :source_rankings_alexa_country => ['source_rankings_alexa_country_example'], 
  :social_shares_count_facebook_min => 56, 
  :social_shares_count_facebook_max => 56, 
  :social_shares_count_google_plus_min => 56, 
  :social_shares_count_google_plus_max => 56, 
  :social_shares_count_linkedin_min => 56, 
  :social_shares_count_linkedin_max => 56, 
  :social_shares_count_reddit_min => 56, 
  :social_shares_count_reddit_max => 56, 
  :clusters => ['clusters_example'], 
  :_return => ['_return_example'], 
  :story_id => 56, 
  :story_url => 'story_url_example', 
  :story_title => 'story_title_example', 
  :story_body => 'story_body_example', 
  :story_published_at => DateTime.parse('2013-10-20T19 =>20 =>30+01 =>00'), 
  :story_language => 'auto', 
  :per_page => 3 
}

begin
  #List coverages
  result = api_instance.list_coverages(opts)
  pp result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_coverages: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$opts = array(
    'id' => array(36521),
    'not_id' => array(36222),
    'title' => "startup AND (raise OR raised OR raising OR raises)",
    'body' => "startup",
    'text' => "startup company",
    'language' => array("en","pt"),
    'not_language' => array("es","it"),
    'published_at_start' => "NOW-10DAYS",
    'published_at_end' => "NOW",
    'categories_taxonomy' => "iptc-subjectcode",
    'categories_confident' => false,
    'categories_id' => array("11000000","11003000"),
    'not_categories_id' => array("04001001"),
    'categories_level' => array(1),
    'not_categories_level' => array(2,3),
    'entities_title_text' => array("GNU/Linux","Microsoft"),
    'not_entities_title_text' => array("Windows","Ireland"),
    'entities_title_type' => array("Software","Organization"),
    'not_entities_title_type' => array("Agent","Person"),
    'entities_title_links_dbpedia' => array("http://dbpedia.org/resource/Linux"),
    'not_entities_title_links_dbpedia' => array("http://dbpedia.org/resource/Microsoft"),
    'entities_body_text' => array("Free Software","Open Source"),
    'not_entities_body_text' => array("Proprietary Software"),
    'entities_body_type' => array("Software","Organization"),
    'not_entities_body_type' => array("Agent","Hardware"),
    'entities_body_links_dbpedia' => array("http://dbpedia.org/resource/Linux"),
    'not_entities_body_links_dbpedia' => array("http://dbpedia.org/resource/Windows"),
    'sentiment_title_polarity' => "positive",
    'not_sentiment_title_polarity' => "neutral",
    'sentiment_body_polarity' => "negative",
    'not_sentiment_body_polarity' => "positive",
    'media_images_count_min' => 1,
    'media_images_count_max' => 4,
    'media_images_width_min' => 640,
    'media_images_width_max' => 1024,
    'media_images_height_min' => 480,
    'media_images_height_max' => 800,
    'media_images_content_length_min' => 25412,
    'media_images_content_length_max' => 369541,
    'media_images_format' => array("JPEG","BMP", "GIF"),
    'not_media_images_format' => array("PNG","TIFF"),
    'media_videos_count_min' => 2,
    'media_videos_count_max' => 5,
    'author_id' => array(4155),
    'not_author_id' => array(3214),
    'author_name' => "John Doe",
    'not_author_name' => "Mike Wally",
    'source_id' => array(122),
    'not_source_id' => array(12, 34),
    'source_name' => array("BBC"),
    'not_source_name' => array("Fox News"),
    'source_domain' => array("bbc.co.uk"),
    'not_source_domain' => array("foxnews.com"),
    'source_locations_country' => array("US", "IE"),
    'not_source_locations_country' => array("IN", "NG"),
    'source_locations_state' => array("California"),
    'not_source_locations_state' => array("Arizona"),
    'source_locations_city' => array("Los Angeles"),
    'not_source_locations_city' => array("Dublin City"),
    'source_scopes_country' => array("IN", "IE"),
    'not_source_scopes_country' => array("US"),
    'source_scopes_state' => array("Wicklow"),
    'not_source_scopes_state' => array("California"),
    'source_scopes_city' => array("Dublin City"),
    'not_source_scopes_city' => array("Cork"),
    'source_scopes_level' => array("local"),
    'not_source_scopes_level' => array("international"),
    'source_links_in_count_min' => 254111,
    'source_links_in_count_max' => 587796,
    'source_rankings_alexa_rank_min' => 255,
    'source_rankings_alexa_rank_max' => 1421,
    'source_rankings_alexa_country' => array("IE"),
    'social_shares_count_facebook_min' => 3521,
    'social_shares_count_facebook_max' => 5841,
    'social_shares_count_google_plus_min' => 65241,
    'social_shares_count_google_plus_max' => 105214,
    'social_shares_count_linkedin_min' => 3254,
    'social_shares_count_linkedin_max' => 5621,
    'social_shares_count_reddit_min' => 255,
    'social_shares_count_reddit_max' => 9541,
    'cluster' => false,
    'cluster_algorithm' => "kmeans",
    'return' => array("id", "title", "published_at"),
    'story_id' => 789,
    'story_url' => "https://techcrunch.com/2016/04/07/aylien-launches-news-analysis-api-powered-by-its-deep-learning-tech/",
    'story_title' => "Aylien launches news analysis API powered by its deep learning tech",
    'story_body' => "Text analysis startup Aylien, which uses deep learning ...",
    'story_published_at' => new \DateTime(),
    'story_language' => "auto",
    'per_page' => 3
);

);
try {
    $result = $apiInstance->listCoverages($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listCoverages: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require("aylien-news-api");
var defaultClient = AylienNewsApi.ApiClient.instance;
// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR APP ID';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_id.apiKeyPrefix = 'Token';
// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_key.apiKeyPrefix = 'Token';

var apiInstance = new AylienNewsApi.DefaultApi();

var opts = {
  'id': [null], 
  'notId': [null], 
  'title': "title_example", 
  'body': "body_example", 
  'text': "text_example", 
  'translationsEnTitle': "translationsEnTitle_example", 
  'translationsEnBody': "translationsEnBody_example", 
  'translationsEnText': "translationsEnText_example", 
  'language': ["null"], 
  'notLanguage': ["null"], 
  'publishedAtStart': "publishedAtStart_example", 
  'publishedAtEnd': "publishedAtEnd_example", 
  'categoriesTaxonomy': "categoriesTaxonomy_example", 
  'categoriesConfident': true, 
  'categoriesId': ["null"], 
  'notCategoriesId': ["null"], 
  'categoriesLevel': [null], 
  'notCategoriesLevel': [null], 
  'entitiesTitleText': ["null"], 
  'notEntitiesTitleText': ["null"], 
  'entitiesTitleType': ["null"], 
  'notEntitiesTitleType': ["null"], 
  'entitiesTitleLinksDbpedia': ["null"], 
  'notEntitiesTitleLinksDbpedia': ["null"], 
  'entitiesBodyText': ["null"], 
  'notEntitiesBodyText': ["null"], 
  'entitiesBodyType': ["null"], 
  'notEntitiesBodyType': ["null"], 
  'entitiesBodyLinksDbpedia': ["null"], 
  'notEntitiesBodyLinksDbpedia': ["null"], 
  'sentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'notSentimentTitlePolarity': "sentimentTitlePolarity_example", 
  'sentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'notSentimentBodyPolarity': "sentimentBodyPolarity_example", 
  'mediaImagesCountMin': 56, 
  'mediaImagesCountMax': 56, 
  'mediaImagesWidthMin': 56, 
  'mediaImagesWidthMax': 56, 
  'mediaImagesHeightMin': 56, 
  'mediaImagesHeightMax': 56, 
  'mediaImagesContentLengthMin': 56, 
  'mediaImagesContentLengthMax': 56, 
  'mediaImagesFormat': ["null"], 
  'notMediaImagesFormat': ["null"], 
  'mediaVideosCountMin': 56, 
  'mediaVideosCountMax': 56, 
  'authorId': [null], 
  'notAuthorId': [null], 
  'authorName': "authorName_example", 
  'notAuthorName': "authorName_example", 
  'sourceId': [null], 
  'notSourceId': [null], 
  'sourceName': ["null"], 
  'notSourceName': ["null"], 
  'sourceDomain': ["null"], 
  'notSourceDomain': ["null"], 
  'sourceLocationsCountry': ["null"], 
  'notSourceLocationsCountry': ["null"], 
  'sourceLocationsState': ["null"], 
  'notSourceLocationsState': ["null"], 
  'sourceLocationsCity': ["null"], 
  'notSourceLocationsCity': ["null"], 
  'sourceScopesCountry': ["null"], 
  'notSourceScopesCountry': ["null"], 
  'sourceScopesState': ["null"], 
  'notSourceScopesState': ["null"], 
  'sourceScopesCity': ["null"], 
  'notSourceScopesCity': ["null"], 
  'sourceScopesLevel': ["null"], 
  'notSourceScopesLevel': ["null"], 
  'sourceLinksInCountMin': 56, 
  'sourceLinksInCountMax': 56, 
  'sourceRankingsAlexaRankMin': 56, 
  'sourceRankingsAlexaRankMax': 56, 
  'sourceRankingsAlexaCountry': ["null"], 
  'socialSharesCountFacebookMin': 56, 
  'socialSharesCountFacebookMax': 56, 
  'socialSharesCountGooglePlusMin': 56, 
  'socialSharesCountGooglePlusMax': 56, 
  'socialSharesCountLinkedinMin': 56, 
  'socialSharesCountLinkedinMax': 56, 
  'socialSharesCountRedditMin': 56, 
  'socialSharesCountRedditMax': 56, 
  'clusters': ["null"], 
  '_return': ["_return_example"], 
  'storyId': 789, 
  'storyUrl': "storyUrl_example", 
  'storyTitle': "storyTitle_example", 
  'storyBody': "storyBody_example", 
  'storyPublishedAt': new Date("2013-10-20T19:20:30+01:00"), 
  'storyLanguage': "auto", 
  'perPage': 3 
};

apiInstance.listCoverages(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.coverages);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi

  coveragesParams := &newsapi.ListCoveragesOpts{
    Id:                             optional.NewInterface([]int64{123}),
    NotId:                          optional.NewInterface([]int64{123}),
    Title:                          optional.NewString("startup"),
    Body:                           optional.NewString("investment"),
    Text:                           optional.NewString("AI"),
    TranslationsEnTitle:            optional.NewString("Trump"),
    TranslationsEnBody:             optional.NewString("bank"),
    TranslationsEnText:             optional.NewString("sanctions"),
    Language:                       optional.NewInterface([]string{"en"}),
    NotLanguage:                    optional.NewInterface([]string{"zh-cn"}),
    PublishedAtStart:               optional.NewString("NOW-1MONTH"),
    PublishedAtEnd:                 optional.NewString("NOW-1DAY"),
    CategoriesTaxonomy:             optional.NewString("iptc-subjectcode"),
    CategoriesConfident:            optional.NewBool(true),
    CategoriesId:                   optional.NewInterface([]string{"04000000"}),
    NotCategoriesId:                optional.NewInterface([]string{"17000000"}),
    CategoriesLevel:                optional.NewInterface([]int32{1}),
    NotCategoriesLevel:             optional.NewInterface([]int32{2, 3}),
    EntitiesTitleText:              optional.NewInterface([]string{"Microsoft", "Apple"}),
    NotEntitiesTitleText:           optional.NewInterface([]string{"Amazon"}),
    EntitiesTitleType:              optional.NewInterface([]string{"Currency"}),
    NotEntitiesTitleType:           optional.NewInterface([]string{"Person"}),
    EntitiesTitleLinksDbpedia:      optional.NewInterface([]string{"http://dbpedia.org/resource/Linux"}),
    NotEntitiesTitleLinksDbpedia:   optional.NewInterface([]string{"http://dbpedia.org/resource/Windows"}),
    EntitiesBodyText:               optional.NewInterface([]string{"Raspberry Pi"}),
    NotEntitiesBodyText:            optional.NewInterface([]string{"Stephen"}),
    EntitiesBodyType:               optional.NewInterface([]string{"Index"}),
    NotEntitiesBodyType:            optional.NewInterface([]string{"Location"}),
    EntitiesBodyLinksDbpedia:       optional.NewInterface([]string{"http://dbpedia.org/resource/Ireland"}),
    NotEntitiesBodyLinksDbpedia:    optional.NewInterface([]string{"http://dbpedia.org/resource/London"}),
    SentimentTitlePolarity:         optional.NewString("positive"),
    NotSentimentTitlePolarity:      optional.NewString("negative"),
    SentimentBodyPolarity:          optional.NewString("positive"),
    NotSentimentBodyPolarity:       optional.NewString("neutral"),
    MediaImagesCountMin:            optional.NewInt32(1),
    MediaImagesCountMax:            optional.NewInt32(4),
    MediaImagesWidthMin:            optional.NewInt32(640),
    MediaImagesWidthMax:            optional.NewInt32(1200),
    MediaImagesHeightMin:           optional.NewInt32(700),
    MediaImagesHeightMax:           optional.NewInt32(1500),
    MediaImagesContentLengthMin:    optional.NewInt32(25000),
    MediaImagesContentLengthMax:    optional.NewInt32(40000),
    MediaImagesFormat:              optional.NewInterface([]string{"JPEG"}),
    NotMediaImagesFormat:           optional.NewInterface([]string{"PNG"}),
    MediaVideosCountMin:            optional.NewInt32(1),
    MediaVideosCountMax:            optional.NewInt32(2),
    AuthorId:                       optional.NewInterface([]int32{123}),
    NotAuthorId:                    optional.NewInterface([]int32{321}),
    AuthorName:                     optional.NewString("Charlie Kelly"),
    NotAuthorName:                  optional.NewString("Frank Reynolds"),
    SourceId:                       optional.NewInterface([]int32{123}),
    NotSourceId:                    optional.NewInterface([]int32{321}),
    SourceName:                     optional.NewInterface([]string{"The Irish Times"}),
    NotSourceName:                  optional.NewInterface([]string{"The Irish Independent"}),
    SourceDomain:                   optional.NewInterface([]string{"bbc.com"}),
    NotSourceDomain:                optional.NewInterface([]string{"cnn.com"}),
    SourceLocationsCountry:         optional.NewInterface([]string{"US"}),
    NotSourceLocationsCountry:      optional.NewInterface([]string{"GB"}),
    SourceLocationsState:           optional.NewInterface([]string{"Florida"}),
    NotSourceLocationsState:        optional.NewInterface([]string{"California"}),
    SourceLocationsCity:            optional.NewInterface([]string{"Miami"}),
    NotSourceLocationsCity:         optional.NewInterface([]string{"Austin"}),
    SourceScopesCountry:            optional.NewInterface([]string{"IE"}),
    NotSourceScopesCountry:         optional.NewInterface([]string{"DE"}),
    SourceScopesState:              optional.NewInterface([]string{"Illinois"}),
    NotSourceScopesState:           optional.NewInterface([]string{"Montana"}),
    SourceScopesCity:               optional.NewInterface([]string{"Sheboygan"}),
    NotSourceScopesCity:            optional.NewInterface([]string{"Westport"}),
    SourceScopesLevel:              optional.NewInterface([]string{"national"}),
    NotSourceScopesLevel:           optional.NewInterface([]string{"international"}),
    SourceLinksInCountMin:          optional.NewInt32(1),
    SourceLinksInCountMax:          optional.NewInt32(3000),
    SourceRankingsAlexaRankMin:     optional.NewInt32(1),
    SourceRankingsAlexaRankMax:     optional.NewInt32(1000),
    SourceRankingsAlexaCountry:     optional.NewInterface([]string{"US"}),
    SocialSharesCountFacebookMin:   optional.NewInt32(10),
    SocialSharesCountFacebookMax:   optional.NewInt32(1000),
    SocialSharesCountGooglePlusMin: optional.NewInt32(10),
    SocialSharesCountGooglePlusMax: optional.NewInt32(1000),
    SocialSharesCountLinkedinMin:   optional.NewInt32(10),
    SocialSharesCountLinkedinMax:   optional.NewInt32(1000),
    SocialSharesCountRedditMin:     optional.NewInt32(10),
    SocialSharesCountRedditMax:     optional.NewInt32(1000),
    Clusters:                       optional.NewInterface([]int32{1234567}),
    Return_:                        optional.NewInterface([]string{"title"}),
    PerPage:                        optional.NewInt32(5),
    StoryId:                        optional.NewInt64(123),
    StoryUrl:                       optional.NewString("https://techcrunch.com/2016/04/07/aylien-launches-news-analysis-api-powered-by-its-deep-learning-tech/"),
    StoryTitle:                     optional.NewString("Aylien launches news analysis API powered by its deep learning tech"),
    StoryBody:                      optional.NewString("Text analysis startup Aylien, which uses deep learning"),
    StoryLanguage:                  optional.NewString("auto"),
  }

  CoveragesResponse, res, err := api.ListCoverages(context.Background(), coveragesParams)

  if err != nil {
    panic(err)
  }

  _ = res

  for _, coverage := range CoveragesResponse.Coverages{
    fmt.Println(coverage)
  }
}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    List<Long> id = Arrays.asList();  
    List<Long> notId = Arrays.asList();  
    String title = "title_example";  
    String body = "body_example";  
    String text = "text_example";  
    String translationsEnTitle = "translationsEnTitle_example";  
    String translationsEnBody = "translationsEnBody_example";  
    String translationsEnText = "translationsEnText_example";  
    List<String> language = Arrays.asList();  
    List<String> notLanguage = Arrays.asList();  
    String publishedAtStart = "publishedAtStart_example";  
    String publishedAtEnd = "publishedAtEnd_example";  
    String categoriesTaxonomy = "categoriesTaxonomy_example";  
    Boolean categoriesConfident = true;  
    List<String> categoriesId = Arrays.asList();  
    List<String> notCategoriesId = Arrays.asList();  
    List<Integer> categoriesLevel = Arrays.asList();  
    List<Integer> notCategoriesLevel = Arrays.asList();  
    List<String> entitiesTitleText = Arrays.asList();  
    List<String> notEntitiesTitleText = Arrays.asList();  
    List<String> entitiesTitleType = Arrays.asList();  
    List<String> notEntitiesTitleType = Arrays.asList();  
    List<String> entitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> entitiesBodyText = Arrays.asList();  
    List<String> notEntitiesBodyText = Arrays.asList();  
    List<String> entitiesBodyType = Arrays.asList();  
    List<String> notEntitiesBodyType = Arrays.asList();  
    List<String> entitiesBodyLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesBodyLinksDbpedia = Arrays.asList();  
    String sentimentTitlePolarity = "sentimentTitlePolarity_example";  
    String notSentimentTitlePolarity = "notSentimentTitlePolarity_example";  
    String sentimentBodyPolarity = "sentimentBodyPolarity_example";  
    String notSentimentBodyPolarity = "notSentimentBodyPolarity_example";  
    Integer mediaImagesCountMin = 56;  
    Integer mediaImagesCountMax = 56;  
    Integer mediaImagesWidthMin = 56;  
    Integer mediaImagesWidthMax = 56;  
    Integer mediaImagesHeightMin = 56;  
    Integer mediaImagesHeightMax = 56;  
    Integer mediaImagesContentLengthMin = 56;  
    Integer mediaImagesContentLengthMax = 56;  
    List<String> mediaImagesFormat = Arrays.asList();  
    List<String> notMediaImagesFormat = Arrays.asList();  
    Integer mediaVideosCountMin = 56;  
    Integer mediaVideosCountMax = 56;  
    List<Integer> authorId = Arrays.asList();  
    List<Integer> notAuthorId = Arrays.asList();  
    String authorName = "authorName_example";  
    String notAuthorName = "notAuthorName_example";  
    List<Integer> sourceId = Arrays.asList();  
    List<Integer> notSourceId = Arrays.asList();  
    List<String> sourceName = Arrays.asList();  
    List<String> notSourceName = Arrays.asList();  
    List<String> sourceDomain = Arrays.asList();  
    List<String> notSourceDomain = Arrays.asList();  
    List<String> sourceLocationsCountry = Arrays.asList();  
    List<String> notSourceLocationsCountry = Arrays.asList();  
    List<String> sourceLocationsState = Arrays.asList();  
    List<String> notSourceLocationsState = Arrays.asList();  
    List<String> sourceLocationsCity = Arrays.asList();  
    List<String> notSourceLocationsCity = Arrays.asList();  
    List<String> sourceScopesCountry = Arrays.asList();  
    List<String> notSourceScopesCountry = Arrays.asList();  
    List<String> sourceScopesState = Arrays.asList();  
    List<String> notSourceScopesState = Arrays.asList();  
    List<String> sourceScopesCity = Arrays.asList();  
    List<String> notSourceScopesCity = Arrays.asList();  
    List<String> sourceScopesLevel = Arrays.asList();  
    List<String> notSourceScopesLevel = Arrays.asList();  
    Integer sourceLinksInCountMin = 56;  
    Integer sourceLinksInCountMax = 56;  
    Integer sourceRankingsAlexaRankMin = 56;  
    Integer sourceRankingsAlexaRankMax = 56;  
    List<String> sourceRankingsAlexaCountry = Arrays.asList();  
    Integer socialSharesCountFacebookMin = 56;  
    Integer socialSharesCountFacebookMax = 56;  
    Integer socialSharesCountGooglePlusMin = 56;  
    Integer socialSharesCountGooglePlusMax = 56;  
    Integer socialSharesCountLinkedinMin = 56;  
    Integer socialSharesCountLinkedinMax = 56;  
    Integer socialSharesCountRedditMin = 56;  
    Integer socialSharesCountRedditMax = 56;  
    List<String> clusters = Arrays.asList();  
    List<String> _return = Arrays.asList();  
    Long storyId = 56L;  
    String storyUrl = "storyUrl_example";  
    String storyTitle = "storyTitle_example";  
    String storyBody = "storyBody_example";  
    OffsetDateTime storyPublishedAt = new OffsetDateTime();  
    String storyLanguage = "auto";  
    Integer perPage = 3;

    try {
      Coverages result = apiInstance.listCoverages()
            .id(id)
            .notId(notId)
            .title(title)
            .body(body)
            .text(text)
            .translationsEnTitle(translationsEnTitle)
            .translationsEnBody(translationsEnBody)
            .translationsEnText(translationsEnText)
            .language(language)
            .notLanguage(notLanguage)
            .publishedAtStart(publishedAtStart)
            .publishedAtEnd(publishedAtEnd)
            .categoriesTaxonomy(categoriesTaxonomy)
            .categoriesConfident(categoriesConfident)
            .categoriesId(categoriesId)
            .notCategoriesId(notCategoriesId)
            .categoriesLevel(categoriesLevel)
            .notCategoriesLevel(notCategoriesLevel)
            .entitiesTitleText(entitiesTitleText)
            .notEntitiesTitleText(notEntitiesTitleText)
            .entitiesTitleType(entitiesTitleType)
            .notEntitiesTitleType(notEntitiesTitleType)
            .entitiesTitleLinksDbpedia(entitiesTitleLinksDbpedia)
            .notEntitiesTitleLinksDbpedia(notEntitiesTitleLinksDbpedia)
            .entitiesBodyText(entitiesBodyText)
            .notEntitiesBodyText(notEntitiesBodyText)
            .entitiesBodyType(entitiesBodyType)
            .notEntitiesBodyType(notEntitiesBodyType)
            .entitiesBodyLinksDbpedia(entitiesBodyLinksDbpedia)
            .notEntitiesBodyLinksDbpedia(notEntitiesBodyLinksDbpedia)
            .sentimentTitlePolarity(sentimentTitlePolarity)
            .notSentimentTitlePolarity(notSentimentTitlePolarity)
            .sentimentBodyPolarity(sentimentBodyPolarity)
            .notSentimentBodyPolarity(notSentimentBodyPolarity)
            .mediaImagesCountMin(mediaImagesCountMin)
            .mediaImagesCountMax(mediaImagesCountMax)
            .mediaImagesWidthMin(mediaImagesWidthMin)
            .mediaImagesWidthMax(mediaImagesWidthMax)
            .mediaImagesHeightMin(mediaImagesHeightMin)
            .mediaImagesHeightMax(mediaImagesHeightMax)
            .mediaImagesContentLengthMin(mediaImagesContentLengthMin)
            .mediaImagesContentLengthMax(mediaImagesContentLengthMax)
            .mediaImagesFormat(mediaImagesFormat)
            .notMediaImagesFormat(notMediaImagesFormat)
            .mediaVideosCountMin(mediaVideosCountMin)
            .mediaVideosCountMax(mediaVideosCountMax)
            .authorId(authorId)
            .notAuthorId(notAuthorId)
            .authorName(authorName)
            .notAuthorName(notAuthorName)
            .sourceId(sourceId)
            .notSourceId(notSourceId)
            .sourceName(sourceName)
            .notSourceName(notSourceName)
            .sourceDomain(sourceDomain)
            .notSourceDomain(notSourceDomain)
            .sourceLocationsCountry(sourceLocationsCountry)
            .notSourceLocationsCountry(notSourceLocationsCountry)
            .sourceLocationsState(sourceLocationsState)
            .notSourceLocationsState(notSourceLocationsState)
            .sourceLocationsCity(sourceLocationsCity)
            .notSourceLocationsCity(notSourceLocationsCity)
            .sourceScopesCountry(sourceScopesCountry)
            .notSourceScopesCountry(notSourceScopesCountry)
            .sourceScopesState(sourceScopesState)
            .notSourceScopesState(notSourceScopesState)
            .sourceScopesCity(sourceScopesCity)
            .notSourceScopesCity(notSourceScopesCity)
            .sourceScopesLevel(sourceScopesLevel)
            .notSourceScopesLevel(notSourceScopesLevel)
            .sourceLinksInCountMin(sourceLinksInCountMin)
            .sourceLinksInCountMax(sourceLinksInCountMax)
            .sourceRankingsAlexaRankMin(sourceRankingsAlexaRankMin)
            .sourceRankingsAlexaRankMax(sourceRankingsAlexaRankMax)
            .sourceRankingsAlexaCountry(sourceRankingsAlexaCountry)
            .socialSharesCountFacebookMin(socialSharesCountFacebookMin)
            .socialSharesCountFacebookMax(socialSharesCountFacebookMax)
            .socialSharesCountGooglePlusMin(socialSharesCountGooglePlusMin)
            .socialSharesCountGooglePlusMax(socialSharesCountGooglePlusMax)
            .socialSharesCountLinkedinMin(socialSharesCountLinkedinMin)
            .socialSharesCountLinkedinMax(socialSharesCountLinkedinMax)
            .socialSharesCountRedditMin(socialSharesCountRedditMin)
            .socialSharesCountRedditMax(socialSharesCountRedditMax)
            .clusters(clusters)
            ._return(_return)
            .storyId(storyId)
            .storyUrl(storyUrl)
            .storyTitle(storyTitle)
            .storyBody(storyBody)
            .storyPublishedAt(storyPublishedAt)
            .storyLanguage(storyLanguage)
            .perPage(perPage)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#listCoverages");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Coverages works similarly to Related Stories in that it tries to find stories that are similar or related to an input article. However, in addition to that, Coverages enforces stricter similarity rules to capture articles that are coverages of the same topics or events as the source article. This allows you to understand the reach a story has had in the media. For example, you can track the coverage of a press release in various outlets using Coverages.

HTTP Request

  • GET https://api.aylien.com/news/coverages
  • POST https://api.aylien.com/news/coverages

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

global_clustering
integer
(query)

This parameter is used for enabling the clustering functionality. Setting the value to 1 enables clustering, 0 disables the functionality. Defaults to 0. Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

clusters[]
array [integer]
(query)

This parameter is used for finding stories associated with a specific cluster (currently accepts one cluster per search).

translations.{language}.title
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the title. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

translations.{language}.body
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the body. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

id[]
array [integer]
(query)

This parameter is used for finding stories by story id.

!id[]
array [integer]
(query)

This parameter is used for excluding stories by story id.

title
string
(query)

This parameter is used for finding stories whose title contains a specific keyword. It supports boolean operators.

body
string
(query)

This parameter is used for finding stories whose body contains a specific keyword. It supports boolean operators.

text
string
(query)

This parameter is used for finding stories whose title or body contains a specific keyword. It supports boolean operators.

language[]
array [string]
(query)

This parameter is used for finding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

!language[]
array [string]
(query)

This parameter is used for excluding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

published_at.start
string
(query)

This parameter is used for finding stories whose published at time is greater than the specified value. Here you can find more information about how to work with dates.

published_at.end
string
(query)

This parameter is used for finding stories whose published at time is less than the specified value. Here you can find more information about how to work with dates.

categories.taxonomy
string
(query)

This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories here.

categories.confident
boolean
(query)

This parameter is used for finding stories whose categories are confident. You can read more about working with categories here.

Default value: true

categories.id[]
array [string]
(query)

This parameter is used for finding stories by categories id. You can read more about working with categories here, and find category ids here.

!categories.id[]
array [string]
(query)

This parameter is used for excluding stories by categories id. You can read more about working with categories here.

categories.level[]
array [integer]
(query)

This parameter is used for finding stories by categories level. You can read more about working with categories here, and find category ids here.

!categories.level[]
array [integer]
(query)

This parameter is used for excluding stories by categories level. You can read more about working with categories here, and find category ids here.

entities.title.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in story titles. You can read more about working with entities here.

!entities.title.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in story titles. You can read more about working with entities here.

entities.title.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in story titles. You can read more about working with entities here.

!entities.title.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in story titles. You can read more about working with entities here.

entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

!entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

entities.body.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in the body of stories. You can read more about working with entities here.

!entities.body.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in the body of stories. You can read more about working with entities here.

entities.body.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in the body of stories. You can read more about working with entities here.

!entities.body.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in the body of stories. You can read more about working with entities here.

entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

!entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

sentiment.title.polarity
string
(query)

This parameter is used for finding stories whose title sentiment is the specified value.

!sentiment.title.polarity
string
(query)

This parameter is used for excluding stories whose title sentiment is the specified value.

sentiment.body.polarity
string
(query)

This parameter is used for finding stories whose body sentiment is the specified value.

!sentiment.body.polarity
string
(query)

This parameter is used for excluding stories whose body sentiment is the specified value.

media.images.count.min
integer
(query)

This parameter is used for finding stories whose number of images is greater than or equal to the specified value.

media.images.count.max
integer
(query)

This parameter is used for finding stories whose number of images is less than or equal to the specified value.

media.images.width.min
integer
(query)

This parameter is used for finding stories whose width of images are greater than or equal to the specified value.

media.images.width.max
integer
(query)

This parameter is used for finding stories whose width of images are less than or equal to the specified value.

media.images.height.min
integer
(query)

This parameter is used for finding stories whose height of images are greater than or equal to the specified value.

media.images.height.max
integer
(query)

This parameter is used for finding stories whose height of images are less than or equal to the specified value.

media.images.content_length.min
integer
(query)

This parameter is used for finding stories whose images content length are greater than or equal to the specified value.

media.images.content_length.max
integer
(query)

This parameter is used for finding stories whose images content length are less than or equal to the specified value.

media.images.format[]
array [string]
(query)

This parameter is used for finding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

!media.images.format[]
array [string]
(query)

This parameter is used for excluding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

media.videos.count.min
integer
(query)

This parameter is used for finding stories whose number of videos is greater than or equal to the specified value.

media.videos.count.max
integer
(query)

This parameter is used for finding stories whose number of videos is less than or equal to the specified value.

author.id[]
array [integer]
(query)

This parameter is used for finding stories whose author id is the specified value.

!author.id[]
array [integer]
(query)

This parameter is used for excluding stories whose author id is the specified value.

author.name
string
(query)

This parameter is used for finding stories whose author full name contains the specified value.

!author.name
string
(query)

This parameter is used for excluding stories whose author full name contains the specified value.

source.id[]
array [integer]
(query)

This parameter is used for finding stories whose source id is the specified value.

!source.id[]
array [integer]
(query)

This parameter is used for excluding stories whose source id is the specified value.

source.name[]
array [string]
(query)

This parameter is used for finding stories whose source name contains the specified value.

!source.name[]
array [string]
(query)

This parameter is used for excluding stories whose source name contains the specified value.

source.domain[]
array [string]
(query)

This parameter is used for finding stories whose source domain is the specified value.

!source.domain[]
array [string]
(query)

This parameter is used for excluding stories whose source domain is the specified value.

source.locations.country[]
array [string]
(query)

This parameter is used for finding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.locations.country[]
array [string]
(query)

This parameter is used for excluding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.locations.state[]
array [string]
(query)

This parameter is used for finding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

!source.locations.state[]
array [string]
(query)

This parameter is used for excluding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

source.locations.city[]
array [string]
(query)

This parameter is used for finding stories whose source city is the specified value. Here you can find more information about how to work with locations.

!source.locations.city[]
array [string]
(query)

This parameter is used for excluding stories whose source city is the specified value. Here you can find more information about how to work with locations.

source.scopes.country[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.scopes.country[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.scopes.state[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

!source.scopes.state[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

source.scopes.city[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

!source.scopes.city[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified city value. Here you can find more information about how to work with locations.

source.scopes.level[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

!source.scopes.level[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified level value. Here you can find more information about how to work with locations.

Available values: international, national, local

source.links_in_count.min
integer
(query)

This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count here.

source.links_in_count.max
integer
(query)

This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count here.

source.rankings.alexa.rank.min
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.rank.max
integer
(query)

This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks here.

source.rankings.alexa.country[]
array [string]
(query)

This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports ISO 3166-1 alpha-2 country codes. You can read more about working with Alexa ranks here.

social_shares_count.facebook.min
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value.

social_shares_count.facebook.max
integer
(query)

This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value.

social_shares_count.google_plus.min
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value.

social_shares_count.google_plus.max
integer
(query)

This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value.

social_shares_count.linkedin.min
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value.

social_shares_count.linkedin.max
integer
(query)

This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value.

social_shares_count.reddit.min
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value.

social_shares_count.reddit.max
integer
(query)

This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value.

cluster
boolean
(query)

This parameter enables clustering for the returned stories. You can read more about working with clustering here.

Default value: false

cluster.algorithm
string
(query)

This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and k-means algorithms. You can read more about working with clustering here.

Default value: lingo

return[]
array [string]
(query)

This parameter is used for specifying return fields.

Available values: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links

story_id
integer
(query)

A story id

story_url
string
(query)

An article or webpage

story_title
string
(query)

Title of the article

story_body
string
(query)

Body of the article

story_published_at
string
(query)

Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the XML Schema specification (ISO 8601).

story_language
string
(query)

This parameter is used for setting the language of the story. It supports ISO 639-1 language codes.

Default value: auto

per_page
integer
(query)

This parameter is used for specifying number of items in each page.

Default value: 3

Response

Code Description
200

An object including an array of coverages

401

Unauthorized

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

  • X-RateLimit-Limit: The number of allowed requests in the current period.
  • X-RateLimit-Remaining: The number of remaining requests in the current period.
  • X-RateLimit-Reset: The remaining window before the rate limit resets in UTC epoch seconds.
500

Internal Server Error

Autocompletes

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'

# Defining host is optional and default to https://api.aylien.com/news
configuration.host = "https://api.aylien.com/news"
# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
  'type': 'source_names', 
  'term': 'News',
  'language': 'en',
  'per_page': 3
}

try:
    # List autocompletes
    api_response = api_instance.list_autocompletes(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_autocompletes: %s\n" % e)
# load the gem
require 'aylien_news_api'
require 'pp'
# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR APP ID'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR APP KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new
type = 'source_names' 
term = 'News'
opts = {
  :language => 'en', 
  :per_page => 3 
}

begin
  #List autocompletes
  result = api_instance.list_autocompletes(type, term, opts)
  pp result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_autocompletes: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$opts = array(
    'type' => 'source_names',
    'term' => 'News',
    'language' => 'en',
    'per_page' => 3
);

try {
    $result = $apiInstance->listAutocompletes($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listAutocompletes: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require('aylien-news-api');
var defaultClient = AylienNewsApi.ApiClient.instance;

// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR_APP_ID';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_id.apiKeyPrefix = 'Token';
// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR_API_KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//app_key.apiKeyPrefix = 'Token';

var apiInstance = new AylienNewsApi.DefaultApi();
var type = 'source_names';
var term = 'News'; 
var opts = {
  'language': "en", 
  'perPage': 3  
};
apiInstance.listAutocompletes(type, term, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.autocompletes);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi

  autocompleteType := "source_names"
  term := "The Daily"

  autocompletesParams := &newsapi.ListAutocompletesOpts{
  Language:      optional.NewString("en"),
  PerPage:      optional.NewInt32(5),
  }

  autocompletesResponse, res, err := api.ListAutocompletes(context.Background(), autocompleteType, term, autocompletesParams)
  if err != nil {
    panic(err)
  }
  _ = res

  for _, result := range autocompletesResponse.Autocompletes{
    fmt.Println(result)
  }

}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    String type = "source_names";  
    String term = "New York";  
    String language = "en";  
    Integer perPage = 3;  

    try {
      Autocompletes result = apiInstance.listAutocompletes(type, term)
            .language(language)
            .perPage(perPage)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#listAutocompletes");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Autocompletes is a helper endpoint that takes a string of characters and an entity type (such as sources, or DBpedia entities) and returns matching entities of the specified type along with additional metadata. For example, if you provide the Autocompletes endpoint with the term "New York C" and select the type dbpedia_resources, the API will return links to the DBpedia resources such as New_York_City, New_York_City_Subway, New_York_City_Police_Department, and so on.

HTTP Request

  • GET https://api.aylien.com/news/autocompletes

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

type *
string
(query)

This parameter is used for defining the type of autocompletes. For a list of accepted types, see the table below.

term *
string
(query)

This parameter is used for finding autocomplete objects that contain the specified value.

language
string
(query)

This parameter is used for autocompletes whose language is the specified value. It supports ISO 639-1 language codes.

Default value: en

per_page
integer
(query)

This parameter is used for specifying number of items in each page.

Default value: 3

Autocomplete Types

The Autocompletes endpoint accepts four types as input, two that return information on News API sources and two that return information from DBpedia.

News API DBpedia

source_names

entity_types

source_domains

dbpedia_resources

Response

Code Description
200

An object including an array of autocompletes

401

Unauthorized

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

  • X-RateLimit-Limit: The number of allowed requests in the current period.
  • X-RateLimit-Remaining: The number of remaining requests in the current period.
  • X-RateLimit-Reset: The remaining window before the rate limit resets in UTC epoch seconds.
500

Internal Server Error

Time Series

from __future__ import print_function
import time
import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_id
configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
configuration = aylien_news_api.Configuration()
# Configure API key authorization: app_key
configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'

# Defining host is optional and default to https://api.aylien.com/news
configuration.host = "https://api.aylien.com/news"
# Create an instance of the API class
api_instance = aylien_news_api.DefaultApi(aylien_news_api.ApiClient(configuration))

opts = {
  'id': [56], 
  'not_id': [56], 
  'title': 'title_example', 
  'body': 'body_example', 
  'text': 'text_example', 
  'translations_en_title': 'translations_en_title_example', 
  'translations_en_body': 'translations_en_body_example', 
  'translations_en_text': 'translations_en_text_example', 
  'language': ['language_example'], 
  'not_language': ['language_example'], 
  'categories_taxonomy': 'categories_taxonomy_example', 
  'categories_confident': True, 
  'categories_id': ['categories_id_example'], 
  'not_categories_id': ['categories_id_example'], 
  'categories_level': [56], 
  'not_categories_level': [56], 
  'entities_title_text': ['entities_title_text_example'], 
  'not_entities_title_text': ['entities_title_text_example'], 
  'entities_title_type': ['entities_title_type_example'], 
  'not_entities_title_type': ['entities_title_type_example'], 
  'entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'not_entities_title_links_dbpedia': ['entities_title_links_dbpedia_example'], 
  'entities_body_text': ['entities_body_text_example'], 
  'not_entities_body_text': ['entities_body_text_example'], 
  'entities_body_type': ['entities_body_type_example'], 
  'not_entities_body_type': ['entities_body_type_example'], 
  'entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'not_entities_body_links_dbpedia': ['entities_body_links_dbpedia_example'], 
  'sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity': 'sentiment_title_polarity_example', 
  'sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity': 'sentiment_body_polarity_example', 
  'media_images_count_min': 56, 
  'media_images_count_max': 56, 
  'media_images_width_min': 56, 
  'media_images_width_max': 56, 
  'media_images_height_min': 56, 
  'media_images_height_max': 56, 
  'media_images_content_length_min': 56, 
  'media_images_content_length_max': 56, 
  'media_images_format': ['media_images_format_example'], 
  'not_media_images_format': ['media_images_format_example'], 
  'media_videos_count_min': 56, 
  'media_videos_count_max': 56, 
  'author_id': [56], 
  'not_author_id': [56], 
  'author_name': 'author_name_example', 
  'not_author_name': 'author_name_example', 
  'source_id': [56], 
  'not_source_id': [56], 
  'source_name': ['source_name_example'], 
  'not_source_name': ['source_name_example'], 
  'source_domain': ['source_domain_example'], 
  'not_source_domain': ['source_domain_example'], 
  'source_locations_country': ['source_locations_country_example'], 
  'not_source_locations_country': ['source_locations_country_example'], 
  'source_locations_state': ['source_locations_state_example'], 
  'not_source_locations_state': ['source_locations_state_example'], 
  'source_locations_city': ['source_locations_city_example'], 
  'not_source_locations_city': ['source_locations_city_example'], 
  'source_scopes_country': ['source_scopes_country_example'], 
  'not_source_scopes_country': ['source_scopes_country_example'], 
  'source_scopes_state': ['source_scopes_state_example'], 
  'not_source_scopes_state': ['source_scopes_state_example'], 
  'source_scopes_city': ['source_scopes_city_example'], 
  'not_source_scopes_city': ['source_scopes_city_example'], 
  'source_scopes_level': ['source_scopes_level_example'], 
  'not_source_scopes_level': ['source_scopes_level_example'], 
  'source_links_in_count_min': 56, 
  'source_links_in_count_max': 56, 
  'source_rankings_alexa_rank_min': 56, 
  'source_rankings_alexa_rank_max': 56, 
  'source_rankings_alexa_country': ['source_rankings_alexa_country_example'], 
  'social_shares_count_facebook_min': 56, 
  'social_shares_count_facebook_max': 56, 
  'social_shares_count_google_plus_min': 56, 
  'social_shares_count_google_plus_max': 56, 
  'social_shares_count_linkedin_min': 56, 
  'social_shares_count_linkedin_max': 56, 
  'social_shares_count_reddit_min': 56, 
  'social_shares_count_reddit_max': 56, 
  'published_at_start': 'NOW-7DAYS/DAY', 
  'published_at_end': 'NOW/DAY', 
  'period': '+1DAY' 
}

try:
    # List time series
    api_response = api_instance.list_time_series(**opts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->list_time_series: %s\n" % e)
# load the gem
require 'aylien_news_api'
require 'pp'
# setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new

opts = {
  :id => [56], 
  :not_id => [56], 
  :title => 'title_example', 
  :body => 'body_example', 
  :text => 'text_example', 
  :translations_en_title => 'translations_en_title_example', 
  :translations_en_body => 'translations_en_body_example', 
  :translations_en_text => 'translations_en_text_example', 
  :language => ['language_example'], 
  :not_language => ['language_example'], 
  :categories_taxonomy => 'categories_taxonomy_example', 
  :categories_confident => true, 
  :categories_id => ['categories_id_example'], 
  :not_categories_id => ['categories_id_example'], 
  :categories_level => [56], 
  :not_categories_level => [56], 
  :entities_title_text => ['entities_title_text_example'], 
  :not_entities_title_text => ['entities_title_text_example'], 
  :entities_title_type => ['entities_title_type_example'], 
  :not_entities_title_type => ['entities_title_type_example'], 
  :entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :not_entities_title_links_dbpedia => ['entities_title_links_dbpedia_example'], 
  :entities_body_text => ['entities_body_text_example'], 
  :not_entities_body_text => ['entities_body_text_example'], 
  :entities_body_type => ['entities_body_type_example'], 
  :not_entities_body_type => ['entities_body_type_example'], 
  :entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :not_entities_body_links_dbpedia => ['entities_body_links_dbpedia_example'], 
  :sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :not_sentiment_title_polarity => 'sentiment_title_polarity_example', 
  :sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :not_sentiment_body_polarity => 'sentiment_body_polarity_example', 
  :media_images_count_min => 56, 
  :media_images_count_max => 56, 
  :media_images_width_min => 56, 
  :media_images_width_max => 56, 
  :media_images_height_min => 56, 
  :media_images_height_max => 56, 
  :media_images_content_length_min => 56, 
  :media_images_content_length_max => 56, 
  :media_images_format => ['media_images_format_example'], 
  :not_media_images_format => ['media_images_format_example'], 
  :media_videos_count_min => 56, 
  :media_videos_count_max => 56, 
  :author_id => [56], 
  :not_author_id => [56], 
  :author_name => 'author_name_example', 
  :not_author_name => 'author_name_example', 
  :source_id => [56], 
  :not_source_id => [56], 
  :source_name => ['source_name_example'], 
  :not_source_name => ['source_name_example'], 
  :source_domain => ['source_domain_example'], 
  :not_source_domain => ['source_domain_example'], 
  :source_locations_country => ['source_locations_country_example'], 
  :not_source_locations_country => ['source_locations_country_example'], 
  :source_locations_state => ['source_locations_state_example'], 
  :not_source_locations_state => ['source_locations_state_example'], 
  :source_locations_city => ['source_locations_city_example'], 
  :not_source_locations_city => ['source_locations_city_example'], 
  :source_scopes_country => ['source_scopes_country_example'], 
  :not_source_scopes_country => ['source_scopes_country_example'], 
  :source_scopes_state => ['source_scopes_state_example'], 
  :not_source_scopes_state => ['source_scopes_state_example'], 
  :source_scopes_city => ['source_scopes_city_example'], 
  :not_source_scopes_city => ['source_scopes_city_example'], 
  :source_scopes_level => ['source_scopes_level_example'], 
  :not_source_scopes_level => ['source_scopes_level_example'], 
  :source_links_in_count_min => 56, 
  :source_links_in_count_max => 56, 
  :source_rankings_alexa_rank_min => 56, 
  :source_rankings_alexa_rank_max => 56, 
  :source_rankings_alexa_country => ['source_rankings_alexa_country_example'], 
  :social_shares_count_facebook_min => 56, 
  :social_shares_count_facebook_max => 56, 
  :social_shares_count_google_plus_min => 56, 
  :social_shares_count_google_plus_max => 56, 
  :social_shares_count_linkedin_min => 56, 
  :social_shares_count_linkedin_max => 56, 
  :social_shares_count_reddit_min => 56, 
  :social_shares_count_reddit_max => 56, 
  :published_at_start => 'NOW-7DAYS/DAY', 
  :published_at_end => 'NOW/DAY', 
  :period => '+1DAY' 
}

begin
  #List time series
  result = api_instance.list_time_series(opts)
  pp result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->list_time_series: #{e}"
end
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: app_id
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer');

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer');


$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

opts = array(
  'id' => array(56), 
  'not_id' => array(56), 
  'title' => 'title_example', 
  'body' => 'body_example', 
  'text' => 'text_example', 
  'translations_en_title' => 'translations_en_title_example', 
  'translations_en_body' => 'translations_en_body_example', 
  'translations_en_text' => 'translations_en_text_example', 
  'language' => array('language_example'), 
  'not_language' => array('language_example'), 
  'categories_taxonomy' => 'categories_taxonomy_example', 
  'categories_confident' => true, 
  'categories_id' => array('categories_id_example'), 
  'not_categories_id' => array('categories_id_example'), 
  'categories_level' => array(56), 
  'not_categories_level' => array(56), 
  'entities_title_text' => array('entities_title_text_example'), 
  'not_entities_title_text' => array('entities_title_text_example'), 
  'entities_title_type' => array('entities_title_type_example'), 
  'not_entities_title_type' => array('entities_title_type_example'), 
  'entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
  'not_entities_title_links_dbpedia' => array('entities_title_links_dbpedia_example'), 
  'entities_body_text' => array('entities_body_text_example'), 
  'not_entities_body_text' => array('entities_body_text_example'), 
  'entities_body_type' => array('entities_body_type_example'), 
  'not_entities_body_type' => array('entities_body_type_example'), 
  'entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
  'not_entities_body_links_dbpedia' => array('entities_body_links_dbpedia_example'), 
  'sentiment_title_polarity' => 'sentiment_title_polarity_example', 
  'not_sentiment_title_polarity' => 'sentiment_title_polarity_example', 
  'sentiment_body_polarity' => 'sentiment_body_polarity_example', 
  'not_sentiment_body_polarity' => 'sentiment_body_polarity_example', 
  'media_images_count_min' => 56, 
  'media_images_count_max' => 56, 
  'media_images_width_min' => 56, 
  'media_images_width_max' => 56, 
  'media_images_height_min' => 56, 
  'media_images_height_max' => 56, 
  'media_images_content_length_min' => 56, 
  'media_images_content_length_max' => 56, 
  'media_images_format' => array('media_images_format_example'), 
  'not_media_images_format' => array('media_images_format_example'), 
  'media_videos_count_min' => 56, 
  'media_videos_count_max' => 56, 
  'author_id' => array(56), 
  'not_author_id' => array(56), 
  'author_name' => 'author_name_example', 
  'not_author_name' => 'author_name_example', 
  'source_id' => array(56), 
  'not_source_id' => array(56), 
  'source_name' => array('source_name_example'), 
  'not_source_name' => array('source_name_example'), 
  'source_domain' => array('source_domain_example'), 
  'not_source_domain' => array('source_domain_example'), 
  'source_locations_country' => array('source_locations_country_example'), 
  'not_source_locations_country' => array('source_locations_country_example'), 
  'source_locations_state' => array('source_locations_state_example'), 
  'not_source_locations_state' => array('source_locations_state_example'), 
  'source_locations_city' => array('source_locations_city_example'), 
  'not_source_locations_city' => array('source_locations_city_example'), 
  'source_scopes_country' => array('source_scopes_country_example'), 
  'not_source_scopes_country' => array('source_scopes_country_example'), 
  'source_scopes_state' => array('source_scopes_state_example'), 
  'not_source_scopes_state' => array('source_scopes_state_example'), 
  'source_scopes_city' => array('source_scopes_city_example'), 
  'not_source_scopes_city' => array('source_scopes_city_example'), 
  'source_scopes_level' => array('source_scopes_level_example'), 
  'not_source_scopes_level' => array('source_scopes_level_example'), 
  'source_links_in_count_min' => 56, 
  'source_links_in_count_max' => 56, 
  'source_rankings_alexa_rank_min' => 56, 
  'source_rankings_alexa_rank_max' => 56, 
  'source_rankings_alexa_country' => array('source_rankings_alexa_country_example'), 
  'social_shares_count_facebook_min' => 56, 
  'social_shares_count_facebook_max' => 56, 
  'social_shares_count_GooglePlus_min' => 56, 
  'social_shares_count_GooglePlus_max' => 56, 
  'social_shares_count_Linkedin_min' => 56, 
  'social_shares_count_Linkedin_max' => 56, 
  'social_shares_count_Reddit_min' => 56, 
  'social_shares_count_Reddit_max' => 56, 
  'published_at_start' => 'NOW-7DAYS/DAY', 
  'published_at_end' => 'NOW/DAY', 
  'period' => '+1DAY'
);

try {
    $result = $apiInstance->listTimeSeries($opts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listTimeSeries: ', $e->getMessage(), PHP_EOL;
}
?>
var AylienNewsApi = require('aylien-news-api');
var defaultClient = AylienNewsApi.ApiClient.instance;
// Configure API key authorization: app_id
var app_id = defaultClient.authentications['app_id'];
app_id.apiKey = 'YOUR APP ID';
// Uncomment the following line to set a prefix for the API key, e.g. 'Token' (defaults to null)
//app_id.apiKeyPrefix = 'Token';
// Configure API key authorization: app_key
var app_key = defaultClient.authentications['app_key'];
app_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. 'Token' (defaults to null)
//app_key.apiKeyPrefix = 'Token';

var apiInstance = new AylienNewsApi.DefaultApi();

var opts = {
  'id': [null], 
  'notId': [null], 
  'title': 'title_example', 
  'body': 'body_example', 
  'text': 'text_example', 
  'translationsEnTitle': 'translationsEnTitle_example', 
  'translationsEnBody': 'translationsEnBody_example', 
  'translationsEnText': 'translationsEnText_example', 
  'language': ['null'], 
  'notLanguage': ['null'], 
  'categoriesTaxonomy': 'categoriesTaxonomy_example', 
  'categoriesConfident': true, 
  'categoriesId': ['null'], 
  'notCategoriesId': ['null'], 
  'categoriesLevel': [null], 
  'notCategoriesLevel': [null], 
  'entitiesTitleText': ['null'], 
  'notEntitiesTitleText': ['null'], 
  'entitiesTitleType': ['null'], 
  'notEntitiesTitleType': ['null'], 
  'entitiesTitleLinksDbpedia': ['null'], 
  'notEntitiesTitleLinksDbpedia': ['null'], 
  'entitiesBodyText': ['null'], 
  'notEntitiesBodyText': ['null'], 
  'entitiesBodyType': ['null'], 
  'notEntitiesBodyType': ['null'], 
  'entitiesBodyLinksDbpedia': ['null'], 
  'notEntitiesBodyLinksDbpedia': ['null'], 
  'sentimentTitlePolarity': 'sentimentTitlePolarity_example', 
  'notSentimentTitlePolarity': 'sentimentTitlePolarity_example', 
  'sentimentBodyPolarity': 'sentimentBodyPolarity_example', 
  'notSentimentBodyPolarity': 'sentimentBodyPolarity_example', 
  'mediaImagesCountMin': 56, 
  'mediaImagesCountMax': 56, 
  'mediaImagesWidthMin': 56, 
  'mediaImagesWidthMax': 56, 
  'mediaImagesHeightMin': 56, 
  'mediaImagesHeightMax': 56, 
  'mediaImagesContentLengthMin': 56, 
  'mediaImagesContentLengthMax': 56, 
  'mediaImagesFormat': ['null'], 
  'notMediaImagesFormat': ['null'], 
  'mediaVideosCountMin': 56, 
  'mediaVideosCountMax': 56, 
  'authorId': [null], 
  'notAuthorId': [null], 
  'authorName': 'authorName_example', 
  'notAuthorName': 'authorName_example', 
  'sourceId': [null], 
  'notSourceId': [null], 
  'sourceName': ['null'], 
  'notSourceName': ['null'], 
  'sourceDomain': ['null'], 
  'notSourceDomain': ['null'], 
  'sourceLocationsCountry': ['null'], 
  'notSourceLocationsCountry': ['null'], 
  'sourceLocationsState': ['null'], 
  'notSourceLocationsState': ['null'], 
  'sourceLocationsCity': ['null'], 
  'notSourceLocationsCity': ['null'], 
  'sourceScopesCountry': ['null'], 
  'notSourceScopesCountry': ['null'], 
  'sourceScopesState': ['null'], 
  'notSourceScopesState': ['null'], 
  'sourceScopesCity': ['null'], 
  'notSourceScopesCity': ['null'], 
  'sourceScopesLevel': ['null'], 
  'notSourceScopesLevel': ['null'], 
  'sourceLinksInCountMin': 56, 
  'sourceLinksInCountMax': 56, 
  'sourceRankingsAlexaRankMin': 56, 
  'sourceRankingsAlexaRankMax': 56, 
  'sourceRankingsAlexaCountry': ['null'], 
  'socialSharesCountFacebookMin': 56, 
  'socialSharesCountFacebookMax': 56, 
  'socialSharesCountGooglePlusMin': 56, 
  'socialSharesCountGooglePlusMax': 56, 
  'socialSharesCountLinkedinMin': 56, 
  'socialSharesCountLinkedinMax': 56, 
  'socialSharesCountRedditMin': 56, 
  'socialSharesCountRedditMax': 56, 
  'publishedAtStart': 'publishedAtStart_example', 
  'publishedAtEnd': 'publishedAtEnd_example', 
  'period': 'period_example' 
};

apiInstance.listTimeSeries(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data.time_series);
  }
});
package main

// Import the library
import (
  "context"
  "fmt"
  newsapi "github.com/AYLIEN/aylien_newsapi_go"
  "github.com/antihax/optional"
)

func main() {

  cfg := newsapi.NewConfiguration()
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR_APP_ID"
  cfg.DefaultHeader["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR_API_KEY"

  client := newsapi.NewAPIClient(cfg)
  api := client.DefaultApi


  timeSeriesParams := &newsapi.ListTimeSeriesOpts{
    Period:                         optional.NewString("+1DAY"),
    PublishedAtStart:               optional.NewString("NOW-1MONTH"),
    PublishedAtEnd:                 optional.NewString("NOW-1DAY"),
    Id:                             optional.NewInterface([]int64{123}),
    NotId:                          optional.NewInterface([]int64{123}),
    Title:                          optional.NewString("startup"),
    Body:                           optional.NewString("investment"),
    Text:                           optional.NewString("AI"),
    TranslationsEnTitle:            optional.NewString("Trump"),
    TranslationsEnBody:             optional.NewString("bank"),
    TranslationsEnText:             optional.NewString("sanctions"),
    Language:                       optional.NewInterface([]string{"en"}),
    NotLanguage:                    optional.NewInterface([]string{"zh-cn"}),
    CategoriesTaxonomy:             optional.NewString("iptc-subjectcode"),
    CategoriesConfident:            optional.NewBool(true),
    CategoriesId:                   optional.NewInterface([]string{"04000000"}),
    NotCategoriesId:                optional.NewInterface([]string{"17000000"}),
    CategoriesLevel:                optional.NewInterface([]int32{1}),
    NotCategoriesLevel:             optional.NewInterface([]int32{2, 3}),
    EntitiesTitleText:              optional.NewInterface([]string{"Microsoft", "Apple"}),
    NotEntitiesTitleText:           optional.NewInterface([]string{"Amazon"}),
    EntitiesTitleType:              optional.NewInterface([]string{"Currency"}),
    NotEntitiesTitleType:           optional.NewInterface([]string{"Person"}),
    EntitiesTitleLinksDbpedia:      optional.NewInterface([]string{"http://dbpedia.org/resource/Linux"}),
    NotEntitiesTitleLinksDbpedia:   optional.NewInterface([]string{"http://dbpedia.org/resource/Windows"}),
    EntitiesBodyText:               optional.NewInterface([]string{"Raspberry Pi"}),
    NotEntitiesBodyText:            optional.NewInterface([]string{"Stephen"}),
    EntitiesBodyType:               optional.NewInterface([]string{"Index"}),
    NotEntitiesBodyType:            optional.NewInterface([]string{"Location"}),
    EntitiesBodyLinksDbpedia:       optional.NewInterface([]string{"http://dbpedia.org/resource/Ireland"}),
    NotEntitiesBodyLinksDbpedia:    optional.NewInterface([]string{"http://dbpedia.org/resource/London"}),
    SentimentTitlePolarity:         optional.NewString("positive"),
    NotSentimentTitlePolarity:      optional.NewString("negative"),
    SentimentBodyPolarity:          optional.NewString("positive"),
    NotSentimentBodyPolarity:       optional.NewString("neutral"),
    MediaImagesCountMin:            optional.NewInt32(1),
    MediaImagesCountMax:            optional.NewInt32(4),
    MediaImagesWidthMin:            optional.NewInt32(640),
    MediaImagesWidthMax:            optional.NewInt32(1200),
    MediaImagesHeightMin:           optional.NewInt32(700),
    MediaImagesHeightMax:           optional.NewInt32(1500),
    MediaImagesContentLengthMin:    optional.NewInt32(25000),
    MediaImagesContentLengthMax:    optional.NewInt32(40000),
    MediaImagesFormat:              optional.NewInterface([]string{"JPEG"}),
    NotMediaImagesFormat:           optional.NewInterface([]string{"PNG"}),
    MediaVideosCountMin:            optional.NewInt32(1),
    MediaVideosCountMax:            optional.NewInt32(2),
    AuthorId:                       optional.NewInterface([]int32{123}),
    NotAuthorId:                    optional.NewInterface([]int32{321}),
    AuthorName:                     optional.NewString("Charlie Kelly"),
    NotAuthorName:                  optional.NewString("Frank Reynolds"),
    SourceId:                       optional.NewInterface([]int32{123}),
    NotSourceId:                    optional.NewInterface([]int32{321}),
    SourceName:                     optional.NewInterface([]string{"The Irish Times"}),
    NotSourceName:                  optional.NewInterface([]string{"The Irish Independent"}),
    SourceDomain:                   optional.NewInterface([]string{"bbc.com"}),
    NotSourceDomain:                optional.NewInterface([]string{"cnn.com"}),
    SourceLocationsCountry:         optional.NewInterface([]string{"US"}),
    NotSourceLocationsCountry:      optional.NewInterface([]string{"GB"}),
    SourceLocationsState:           optional.NewInterface([]string{"Florida"}),
    NotSourceLocationsState:        optional.NewInterface([]string{"California"}),
    SourceLocationsCity:            optional.NewInterface([]string{"Miami"}),
    NotSourceLocationsCity:         optional.NewInterface([]string{"Austin"}),
    SourceScopesCountry:            optional.NewInterface([]string{"IE"}),
    NotSourceScopesCountry:         optional.NewInterface([]string{"DE"}),
    SourceScopesState:              optional.NewInterface([]string{"Illinois"}),
    NotSourceScopesState:           optional.NewInterface([]string{"Montana"}),
    SourceScopesCity:               optional.NewInterface([]string{"Sheboygan"}),
    NotSourceScopesCity:            optional.NewInterface([]string{"Westport"}),
    SourceScopesLevel:              optional.NewInterface([]string{"national"}),
    NotSourceScopesLevel:           optional.NewInterface([]string{"international"}),
    SourceLinksInCountMin:          optional.NewInt32(1),
    SourceLinksInCountMax:          optional.NewInt32(3000),
    SourceRankingsAlexaRankMin:     optional.NewInt32(1),
    SourceRankingsAlexaRankMax:     optional.NewInt32(1000),
    SourceRankingsAlexaCountry:     optional.NewInterface([]string{"US"}),
    SocialSharesCountFacebookMin:   optional.NewInt32(10),
    SocialSharesCountFacebookMax:   optional.NewInt32(1000),
    SocialSharesCountGooglePlusMin: optional.NewInt32(10),
    SocialSharesCountGooglePlusMax: optional.NewInt32(1000),
    SocialSharesCountLinkedinMin:   optional.NewInt32(10),
    SocialSharesCountLinkedinMax:   optional.NewInt32(1000),
    SocialSharesCountRedditMin:     optional.NewInt32(10),
    SocialSharesCountRedditMax:     optional.NewInt32(1000),
  }

  timeSeriesResponse, res, err := api.ListTimeSeries(context.Background(), timeSeriesParams)

  if err != nil {
    panic(err)
  }

  _ = res

  for _, period := range timeSeriesResponse.TimeSeries {
    fmt.Println(period)
  }
}
package com.example;

import com.aylien.newsapi.ApiClient;
import com.aylien.newsapi.ApiException;
import com.aylien.newsapi.Configuration;
import com.aylien.newsapi.api.DefaultApi;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.aylien.com/news/");

    // Configure API key authorization: app_id
    ApiKeyAuth app_id = (ApiKeyAuth)defaultClient.getAuthentication("app_id");
    app_id.setApiKey("YOUR_APP_ID");

    // Configure API key authorization: app_key
    ApiKeyAuth app_key = (ApiKeyAuth)defaultClient.getAuthentication("app_key");
    app_key.setApiKey("YOUR_API_KEY");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    List<Long> id = Arrays.asList();  
    List<Long> notId = Arrays.asList();  
    String title = "Liverpool";  
    String body = "body_example";  
    String text = "text_example";  
    String translationsEnTitle = "translationsEnTitle_example";  
    String translationsEnBody = "translationsEnBody_example";  
    String translationsEnText = "translationsEnText_example";  
    List<String> language = Arrays.asList();  
    List<String> notLanguage = Arrays.asList();  
    String categoriesTaxonomy = "categoriesTaxonomy_example";  
    Boolean categoriesConfident = true;  
    List<String> categoriesId = Arrays.asList();  
    List<String> notCategoriesId = Arrays.asList();  
    List<Integer> categoriesLevel = Arrays.asList();  
    List<Integer> notCategoriesLevel = Arrays.asList();  
    List<String> entitiesTitleText = Arrays.asList();  
    List<String> notEntitiesTitleText = Arrays.asList();  
    List<String> entitiesTitleType = Arrays.asList();  
    List<String> notEntitiesTitleType = Arrays.asList();  
    List<String> entitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesTitleLinksDbpedia = Arrays.asList();  
    List<String> entitiesBodyText = Arrays.asList();  
    List<String> notEntitiesBodyText = Arrays.asList();  
    List<String> entitiesBodyType = Arrays.asList();  
    List<String> notEntitiesBodyType = Arrays.asList();  
    List<String> entitiesBodyLinksDbpedia = Arrays.asList();  
    List<String> notEntitiesBodyLinksDbpedia = Arrays.asList();  
    String sentimentTitlePolarity = "sentimentTitlePolarity_example";  
    String notSentimentTitlePolarity = "notSentimentTitlePolarity_example";  
    String sentimentBodyPolarity = "sentimentBodyPolarity_example";  
    String notSentimentBodyPolarity = "notSentimentBodyPolarity_example";  
    Integer mediaImagesCountMin = 56;  
    Integer mediaImagesCountMax = 56;  
    Integer mediaImagesWidthMin = 56;  
    Integer mediaImagesWidthMax = 56;  
    Integer mediaImagesHeightMin = 56;  
    Integer mediaImagesHeightMax = 56;  
    Integer mediaImagesContentLengthMin = 56;  
    Integer mediaImagesContentLengthMax = 56;  
    List<String> mediaImagesFormat = Arrays.asList();  
    List<String> notMediaImagesFormat = Arrays.asList();  
    Integer mediaVideosCountMin = 56;  
    Integer mediaVideosCountMax = 56;  
    List<Integer> authorId = Arrays.asList();  
    List<Integer> notAuthorId = Arrays.asList();  
    String authorName = "authorName_example";  
    String notAuthorName = "notAuthorName_example";  
    List<Integer> sourceId = Arrays.asList();  
    List<Integer> notSourceId = Arrays.asList();  
    List<String> sourceName = Arrays.asList();  
    List<String> notSourceName = Arrays.asList();  
    List<String> sourceDomain = Arrays.asList();  
    List<String> notSourceDomain = Arrays.asList();  
    List<String> sourceLocationsCountry = Arrays.asList();  
    List<String> notSourceLocationsCountry = Arrays.asList();  
    List<String> sourceLocationsState = Arrays.asList();  
    List<String> notSourceLocationsState = Arrays.asList();  
    List<String> sourceLocationsCity = Arrays.asList();  
    List<String> notSourceLocationsCity = Arrays.asList();  
    List<String> sourceScopesCountry = Arrays.asList();  
    List<String> notSourceScopesCountry = Arrays.asList();  
    List<String> sourceScopesState = Arrays.asList();  
    List<String> notSourceScopesState = Arrays.asList();  
    List<String> sourceScopesCity = Arrays.asList();  
    List<String> notSourceScopesCity = Arrays.asList();  
    List<String> sourceScopesLevel = Arrays.asList();  
    List<String> notSourceScopesLevel = Arrays.asList();  
    Integer sourceLinksInCountMin = 56;  
    Integer sourceLinksInCountMax = 56;  
    Integer sourceRankingsAlexaRankMin = 56;  
    Integer sourceRankingsAlexaRankMax = 56;  
    List<String> sourceRankingsAlexaCountry = Arrays.asList();  
    Integer socialSharesCountFacebookMin = 56;  
    Integer socialSharesCountFacebookMax = 56;  
    Integer socialSharesCountGooglePlusMin = 56;  
    Integer socialSharesCountGooglePlusMax = 56;  
    Integer socialSharesCountLinkedinMin = 56;  
    Integer socialSharesCountLinkedinMax = 56;  
    Integer socialSharesCountRedditMin = 56;  
    Integer socialSharesCountRedditMax = 56;  
    String publishedAtStart = "NOW-30DAYS";
    String publishedAtEnd = "NOW";
    String period = "+1DAY";  
    try {
      TimeSeriesList result = apiInstance.listTimeSeries()
            .id(id)
            .notId(notId)
            .title(title)
            .body(body)
            .text(text)
            .translationsEnTitle(translationsEnTitle)
            .translationsEnBody(translationsEnBody)
            .translationsEnText(translationsEnText)
            .language(language)
            .notLanguage(notLanguage)
            .categoriesTaxonomy(categoriesTaxonomy)
            .categoriesConfident(categoriesConfident)
            .categoriesId(categoriesId)
            .notCategoriesId(notCategoriesId)
            .categoriesLevel(categoriesLevel)
            .notCategoriesLevel(notCategoriesLevel)
            .entitiesTitleText(entitiesTitleText)
            .notEntitiesTitleText(notEntitiesTitleText)
            .entitiesTitleType(entitiesTitleType)
            .notEntitiesTitleType(notEntitiesTitleType)
            .entitiesTitleLinksDbpedia(entitiesTitleLinksDbpedia)
            .notEntitiesTitleLinksDbpedia(notEntitiesTitleLinksDbpedia)
            .entitiesBodyText(entitiesBodyText)
            .notEntitiesBodyText(notEntitiesBodyText)
            .entitiesBodyType(entitiesBodyType)
            .notEntitiesBodyType(notEntitiesBodyType)
            .entitiesBodyLinksDbpedia(entitiesBodyLinksDbpedia)
            .notEntitiesBodyLinksDbpedia(notEntitiesBodyLinksDbpedia)
            .sentimentTitlePolarity(sentimentTitlePolarity)
            .notSentimentTitlePolarity(notSentimentTitlePolarity)
            .sentimentBodyPolarity(sentimentBodyPolarity)
            .notSentimentBodyPolarity(notSentimentBodyPolarity)
            .mediaImagesCountMin(mediaImagesCountMin)
            .mediaImagesCountMax(mediaImagesCountMax)
            .mediaImagesWidthMin(mediaImagesWidthMin)
            .mediaImagesWidthMax(mediaImagesWidthMax)
            .mediaImagesHeightMin(mediaImagesHeightMin)
            .mediaImagesHeightMax(mediaImagesHeightMax)
            .mediaImagesContentLengthMin(mediaImagesContentLengthMin)
            .mediaImagesContentLengthMax(mediaImagesContentLengthMax)
            .mediaImagesFormat(mediaImagesFormat)
            .notMediaImagesFormat(notMediaImagesFormat)
            .mediaVideosCountMin(mediaVideosCountMin)
            .mediaVideosCountMax(mediaVideosCountMax)
            .authorId(authorId)
            .notAuthorId(notAuthorId)
            .authorName(authorName)
            .notAuthorName(notAuthorName)
            .sourceId(sourceId)
            .notSourceId(notSourceId)
            .sourceName(sourceName)
            .notSourceName(notSourceName)
            .sourceDomain(sourceDomain)
            .notSourceDomain(notSourceDomain)
            .sourceLocationsCountry(sourceLocationsCountry)
            .notSourceLocationsCountry(notSourceLocationsCountry)
            .sourceLocationsState(sourceLocationsState)
            .notSourceLocationsState(notSourceLocationsState)
            .sourceLocationsCity(sourceLocationsCity)
            .notSourceLocationsCity(notSourceLocationsCity)
            .sourceScopesCountry(sourceScopesCountry)
            .notSourceScopesCountry(notSourceScopesCountry)
            .sourceScopesState(sourceScopesState)
            .notSourceScopesState(notSourceScopesState)
            .sourceScopesCity(sourceScopesCity)
            .notSourceScopesCity(notSourceScopesCity)
            .sourceScopesLevel(sourceScopesLevel)
            .notSourceScopesLevel(notSourceScopesLevel)
            .sourceLinksInCountMin(sourceLinksInCountMin)
            .sourceLinksInCountMax(sourceLinksInCountMax)
            .sourceRankingsAlexaRankMin(sourceRankingsAlexaRankMin)
            .sourceRankingsAlexaRankMax(sourceRankingsAlexaRankMax)
            .sourceRankingsAlexaCountry(sourceRankingsAlexaCountry)
            .socialSharesCountFacebookMin(socialSharesCountFacebookMin)
            .socialSharesCountFacebookMax(socialSharesCountFacebookMax)
            .socialSharesCountGooglePlusMin(socialSharesCountGooglePlusMin)
            .socialSharesCountGooglePlusMax(socialSharesCountGooglePlusMax)
            .socialSharesCountLinkedinMin(socialSharesCountLinkedinMin)
            .socialSharesCountLinkedinMax(socialSharesCountLinkedinMax)
            .socialSharesCountRedditMin(socialSharesCountRedditMin)
            .socialSharesCountRedditMax(socialSharesCountRedditMax)
            .publishedAtStart(publishedAtStart)
            .publishedAtEnd(publishedAtEnd)
            .period(period)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#listTimeSeries");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Time Series allows you to track changes in quantitative values contained in stories over time. This information can be anything from mentions of a topic or entities, sentiment about a topic, or the volume of stories published by a source, to name but a few. The full list of parameters is given below. Using the Date Math Syntax, you can easily set your query to return information from any time period, from the current point in time to when the News API started collecting stories. The returned information can be rounded to a time also specified by you, for example by setting the results into hourly, daily, or weekly data points.

HTTP Request

  • GET https://api.aylien.com/news/time_series

Parameters

Name Description
X-AYLIEN-NewsAPI-Application-ID *
string
(header)
x-data-threescale-name: app_ids

Your access API ID

X-AYLIEN-NewsAPI-Application-Key *
string
(header)
x-data-threescale-name: app_keys

Your access API Key

global_clustering
integer
(query)

This parameter is used for enabling the clustering functionality. Setting the value to 1 enables clustering, 0 disables the functionality. Defaults to 0. Clustering requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

clusters[]
array [integer]
(query)

This parameter is used for finding stories associated with a specific cluster (currently accepts one cluster per search).

translations.{language}.title
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the title. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

translations.{language}.body
string
(query)

This parameter is used for filtering stories translated from a specified language containing a query term in the body. To specify a language, use the ISO 639-1 standard. Translation requires an Advanced or Enterprise license key. Start a free trial or contact sales to upgrade your account.

id[]
array [integer]
(query)

This parameter is used for finding stories by story id.

!id[]
array [integer]
(query)

This parameter is used for excluding stories by story id.

title
string
(query)

This parameter is used for finding stories whose title contains a specific keyword. It supports boolean operators.

body
string
(query)

This parameter is used for finding stories whose body contains a specific keyword. It supports boolean operators.

text
string
(query)

This parameter is used for finding stories whose title or body contains a specific keyword. It supports boolean operators.

language[]
array [string]
(query)

This parameter is used for finding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

!language[]
array [string]
(query)

This parameter is used for excluding stories whose language is the specified value. It supports ISO 639-1 language codes.

Available values: en, de, fr, it, es, pt, ru, nl, ar, tr, zh-tw, zh-cn, sv, da.

categories.taxonomy
string
(query)

This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories here.

categories.confident
boolean
(query)

This parameter is used for finding stories whose categories are confident. You can read more about working with categories here.

Default value: true

categories.id[]
array [string]
(query)

This parameter is used for finding stories by categories id. You can read more about working with categories here, and find category ids here.

!categories.id[]
array [string]
(query)

This parameter is used for excluding stories by categories id. You can read more about working with categories here, and find category ids here.

categories.level[]
array [integer]
(query)

This parameter is used for finding stories by categories level. You can read more about working with categories here, and find category ids here.

!categories.level[]
array [integer]
(query)

This parameter is used for excluding stories by categories level. You can read more about working with categories here, and find category ids here.

entities.title.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in story titles. You can read more about working with entities here.

!entities.title.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in story titles. You can read more about working with entities here.

entities.title.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in story titles. You can read more about working with entities here.

!entities.title.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in story titles. You can read more about working with entities here.

entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

!entities.title.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities here.

entities.body.text[]
array [string]
(query)

This parameter is used to find stories based on the specified entities text in the body of stories. You can read more about working with entities here.

!entities.body.text[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities text in the body of stories. You can read more about working with entities here.

entities.body.type[]
array [string]
(query)

This parameter is used to find stories based on the specified entities type in the body of stories. You can read more about working with entities here.

!entities.body.type[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities type in the body of stories. You can read more about working with entities here.

entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

!entities.body.links.dbpedia[]
array [string]
(query)

This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities here.

sentiment.title.polarity
string
(query)

This parameter is used for finding stories whose title sentiment is the specified value.

!sentiment.title.polarity
string
(query)

This parameter is used for excluding stories whose title sentiment is the specified value.

sentiment.body.polarity
string
(query)

This parameter is used for finding stories whose body sentiment is the specified value.

!sentiment.body.polarity
string
(query)

This parameter is used for excluding stories whose body sentiment is the specified value.

media.images.count.min
integer
(query)

This parameter is used for finding stories whose number of images is greater than or equal to the specified value.

media.images.count.max
integer
(query)

This parameter is used for finding stories whose number of images is less than or equal to the specified value.

media.images.width.min
integer
(query)

This parameter is used for finding stories whose width of images are greater than or equal to the specified value.

media.images.width.max
integer
(query)

This parameter is used for finding stories whose width of images are less than or equal to the specified value.

media.images.height.min
integer
(query)

This parameter is used for finding stories whose height of images are greater than or equal to the specified value.

media.images.height.max
integer
(query)

This parameter is used for finding stories whose height of images are less than or equal to the specified value.

media.images.content_length.min
integer
(query)

This parameter is used for finding stories whose images content length are greater than or equal to the specified value.

media.images.content_length.max
integer
(query)

This parameter is used for finding stories whose images content length are less than or equal to the specified value.

media.images.format[]
array [string]
(query)

This parameter is used for finding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

!media.images.format[]
array [string]
(query)

This parameter is used for excluding stories whose images format are the specified value.

Available values: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG

media.videos.count.min
integer
(query)

This parameter is used for finding stories whose number of videos is greater than or equal to the specified value.

media.videos.count.max
integer
(query)

This parameter is used for finding stories whose number of videos is less than or equal to the specified value.

author.id[]
array [integer]
(query)

This parameter is used for finding stories whose author id is the specified value.

!author.id[]
array [integer]
(query)

This parameter is used for excluding stories whose author id is the specified value.

author.name
string
(query)

This parameter is used for finding stories whose author full name contains the specified value.

!author.name
string
(query)

This parameter is used for excluding stories whose author full name contains the specified value.

source.id[]
array [integer]
(query)

This parameter is used for finding stories whose source id is the specified value.

!source.id[]
array [integer]
(query)

This parameter is used for excluding stories whose source id is the specified value.

source.name[]
array [string]
(query)

This parameter is used for finding stories whose source name contains the specified value.

!source.name[]
array [string]
(query)

This parameter is used for excluding stories whose source name contains the specified value.

source.domain[]
array [string]
(query)

This parameter is used for finding stories whose source domain is the specified value.

!source.domain[]
array [string]
(query)

This parameter is used for excluding stories whose source domain is the specified value.

source.locations.country[]
array [string]
(query)

This parameter is used for finding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.locations.country[]
array [string]
(query)

This parameter is used for excluding stories whose source country is the specified value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.locations.state[]
array [string]
(query)

This parameter is used for finding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

!source.locations.state[]
array [string]
(query)

This parameter is used for excluding stories whose source state/province is the specified value. Here you can find more information about how to work with locations.

source.locations.city[]
array [string]
(query)

This parameter is used for finding stories whose source city is the specified value. Here you can find more information about how to work with locations.

!source.locations.city[]
array [string]
(query)

This parameter is used for excluding stories whose source city is the specified value. Here you can find more information about how to work with locations.

source.scopes.country[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

!source.scopes.country[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified country value. It supports ISO 3166-1 alpha-2 country codes. Here you can find more information about how to work with locations.

source.scopes.state[]
array [string]
(query)

This parameter is used for finding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

!source.scopes.state[]
array [string]
(query)

This parameter is used for excluding stories whose source scopes is the specified state/province value. Here you can find more information about how to work with locations.

source.scopes.city[]
array [string]
(query)