Time series
Show me this endpoint for

About

The time series endpoint allows you to track information 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.

Parameters

Name Type Description Notes
id list[int] This parameter is used for finding stories by story id. [optional]
not_id list[int] This parameter is used for excluding stories by story id. [optional]
title str This parameter is used for finding stories whose title contains a specfic keyword. It supports boolean operators. [optional]
body str This parameter is used for finding stories whose body contains a specfic keyword. It supports boolean operators. [optional]
text str This parameter is used for finding stories whose title or body contains a specfic keyword. It supports boolean operators. [optional]
language list[str] This parameter is used for finding stories whose language is the specified value. It supports ISO 639-1 language codes. [optional] [enum: en, de, fr, it, es, pt]
not_language list[str] This parameter is used for excluding stories whose language is the specified value. It supports ISO 639-1 language codes. [optional] [enum: en, de, fr, it, es, pt]
categories_taxonomy str 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. [optional] [enum: iab-qag, iptc-subjectcode]
categories_confident bool This parameter is used for finding stories whose categories are confident. You can read more about working with categories here. [optional] [default to true]
categories_id list[str] This parameter is used for finding stories by categories id. You can read more about working with categories here. [optional]
not_categories_id list[str] This parameter is used for excluding stories by categories id. You can read more about working with categories here. [optional]
categories_level list[int] This parameter is used for finding stories by categories level. You can read more about working with categories here. [optional]
not_categories_level list[int] This parameter is used for excluding stories by categories level. You can read more about working with categories here. [optional]
entities_title_text list[str] 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. [optional]
not_entities_title_text list[str] 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. [optional]
entities_title_type list[str] 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. [optional]
not_entities_title_type list[str] 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. [optional]
entities_title_links_dbpedia list[str] 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. [optional]
not_entities_title_links_dbpedia list[str] 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. [optional]
entities_body_text list[str] 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. [optional]
not_entities_body_text list[str] 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. [optional]
entities_body_type list[str] 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. [optional]
not_entities_body_type list[str] 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. [optional]
entities_body_links_dbpedia list[str] 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. [optional]
not_entities_body_links_dbpedia list[str] 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. [optional]
sentiment_title_polarity str This parameter is used for finding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
not_sentiment_title_polarity str This parameter is used for excluding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
sentiment_body_polarity str This parameter is used for finding stories whose body sentiment is the specified value. [optional] [enum: positive, neutral, negative]
not_sentiment_body_polarity str This parameter is used for excluding stories whose body sentiment is the specified value. [optional] [enum: positive, neutral, negative]
media_images_count_min int This parameter is used for finding stories whose number of images is greater than or equal to the specified value. [optional]
media_images_count_max int This parameter is used for finding stories whose number of images is less than or equal to the specified value. [optional]
media_images_width_min int This parameter is used for finding stories whose width of images are greater than or equal to the specified value. [optional]
media_images_width_max int This parameter is used for finding stories whose width of images are less than or equal to the specified value. [optional]
media_images_height_min int This parameter is used for finding stories whose height of images are greater than or equal to the specified value. [optional]
media_images_height_max int This parameter is used for finding stories whose height of images are less than or equal to the specified value. [optional]
media_images_content_length_min int This parameter is used for finding stories whose images content length are greater than or equal to the specified value. [optional]
media_images_content_length_max int This parameter is used for finding stories whose images content length are less than or equal to the specified value. [optional]
media_images_format list[str] This parameter is used for finding stories whose images format are the specified value. [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG]
not_media_images_format list[str] This parameter is used for excluding stories whose images format are the specified value. [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG]
media_videos_count_min int This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. [optional]
media_videos_count_max int This parameter is used for finding stories whose number of videos is less than or equal to the specified value. [optional]
author_id list[int] This parameter is used for finding stories whose author id is the specified value. [optional]
not_author_id list[int] This parameter is used for excluding stories whose author id is the specified value. [optional]
author_name str This parameter is used for finding stories whose author full name contains the specified value. [optional]
not_author_name str This parameter is used for excluding stories whose author full name contains the specified value. [optional]
source_id list[int] This parameter is used for finding stories whose source id is the specified value. [optional]
not_source_id list[int] This parameter is used for excluding stories whose source id is the specified value. [optional]
source_name list[str] This parameter is used for finding stories whose source name contains the specified value. [optional]
not_source_name list[str] This parameter is used for excluding stories whose source name contains the specified value. [optional]
source_domain list[str] This parameter is used for finding stories whose source domain is the specified value. [optional]
not_source_domain list[str] This parameter is used for excluding stories whose source domain is the specified value. [optional]
source_locations_country list[str] 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. [optional]
not_source_locations_country list[str] 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. [optional]
source_locations_state list[str] 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. [optional]
not_source_locations_state list[str] 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. [optional]
source_locations_city list[str] 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. [optional]
not_source_locations_city list[str] 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. [optional]
source_scopes_country list[str] 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. [optional]
not_source_scopes_country list[str] 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. [optional]
source_scopes_state list[str] 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. [optional]
not_source_scopes_state list[str] 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. [optional]
source_scopes_city list[str] 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. [optional]
not_source_scopes_city list[str] 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. [optional]
source_scopes_level list[str] 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. [optional] [enum: international, national, local]
not_source_scopes_level list[str] 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. [optional] [enum: international, national, local]
source_links_in_count_min int 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. [optional]
source_links_in_count_max int 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. [optional]
source_rankings_alexa_rank_min int 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. [optional]
source_rankings_alexa_rank_max int 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. [optional]
source_rankings_alexa_country list[str] 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. [optional]
social_shares_count_facebook_min int This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. [optional]
social_shares_count_facebook_max int This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. [optional]
social_shares_count_google_plus_min int This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. [optional]
social_shares_count_google_plus_max int This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. [optional]
social_shares_count_linkedin_min int This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. [optional]
social_shares_count_linkedin_max int This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. [optional]
social_shares_count_reddit_min int This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. [optional]
social_shares_count_reddit_max int This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. [optional]
published_at_start str 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. [optional] [default to NOW-7DAYS/DAY]
published_at_end str 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. [optional] [default to NOW/DAY]
period str The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are Supported keywords. [optional] [default to +1DAY]

Return type

TimeSeriesList

Example

import aylien_news_api
from aylien_news_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: app_id
aylien_news_api.configuration.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR_APP_ID'
# Configure API key authorization: app_key
aylien_news_api.configuration.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR_APP_KEY'

# create an instance of the API class
api_instance = aylien_news_api.DefaultApi()


opts = { 
    'id': [521411],
    'not_id': [2511],
    'title': 'startup AND (raise OR raised OR raising OR raises)',
    'body': 'startup',
    'text': 'startup company',
    'language': ['en', 'it'],
    'not_language': ['es', 'pt'],
    'categories_taxonomy': 'iab-qag',
    'categories_confident': True,
    'categories_id': ['IAB15', 'IAB1-2'],
    'not_categories_id': ['IAB10', 'IAB3'],
    'categories_level': [1],
    'not_categories_level': [2],
    'entities_title_text': ['GNU/Linux'],
    'not_entities_title_text': ['Microsoft', 'Google'],
    'entities_title_type': ['Software', 'Organization'],
    'not_entities_title_type': ['Agent', 'Person'],
    'entities_title_links_dbpedia': ['http://dbpedia.org/resource/Donald_Trump'],
    'not_entities_title_links_dbpedia': ['http://dbpedia.org/resource/Windows'],
    'entities_body_text': ['GNU/Linux', 'Microsoft'],
    'not_entities_body_text': ['Windows Vista', 'Windows XP'],
    'entities_body_type': ['Software', 'Organization'],
    'not_entities_body_type': ['Agent', 'Person'],
    'entities_body_links_dbpedia': ['http://dbpedia.org/resource/Microsoft'],
    'not_entities_body_links_dbpedia': ['http://dbpedia.org/resource/Google'],
    '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': 10,
    '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': ['PNG', 'TIFF'],
    'media_videos_count_min': 3,
    'media_videos_count_max': 5,
    'author_id': [352],
    'not_author_id': [541],
    'author_name': 'John Doe',
    'not_author_name': 'Mike Wally',
    'source_id': [1456],
    'not_source_id': [142],
    'source_name': ['BBC'],
    'not_source_name': ['Fox News'],
    'source_domain': ['bbc.co.uk'],
    'not_source_domain': ['foxnews.com'],
    'source_locations_country': ['US'],
    'not_source_locations_country': ['BR'],
    'source_locations_state': ['California'],
    'not_source_locations_state': ['Berkshire'],
    'source_locations_city': ['London'],
    'not_source_locations_city': ['Dublin'],
    'source_scopes_country': ['IE'],
    'not_source_scopes_country': ['IN'],
    'source_scopes_state': ['Tehran'],
    'not_source_scopes_state': ['Berkshire'],
    'source_scopes_city': ['Dublin'],
    'not_source_scopes_city': ['New York City'],
    'source_scopes_level': ['local'],
    'not_source_scopes_level': ['national'],
    'source_links_in_count_min': 401444,
    'source_links_in_count_max': 500000,
    'source_rankings_alexa_rank_min': 3,
    'source_rankings_alexa_rank_max': 100,
    'source_rankings_alexa_country': ['IE'],
    'social_shares_count_facebook_min': 3521,
    'social_shares_count_facebook_max': 2514,
    'social_shares_count_google_plus_min': 6521,
    'social_shares_count_google_plus_max': 36524,
    'social_shares_count_linkedin_min': 6528,
    'social_shares_count_linkedin_max': 952141,
    'social_shares_count_reddit_min': 14251,
    'social_shares_count_reddit_max': 95874,
    '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:
    pprint("Exception when calling DefaultApi->list_time_series: %s\n" % e)