Histograms
Show me this endpoint for

About

For the numerical metadata that the News API gathers (such as word counts or social shares for example), you can use the histograms endpoint to access and display this information.

As this endpoint does not return actual stories, the results you are given will not count towards your story allowance provided by your subscription, so you can effectively query this endpoint free of charge.

Parameters

Name Type Description Notes
id int[] This parameter is used for finding stories by story id. [optional]
not_id int[] This parameter is used for excluding stories by story id. [optional]
title string This parameter is used for finding stories whose title contains a specfic keyword. It supports boolean operators. [optional]
body string This parameter is used for finding stories whose body contains a specfic keyword. It supports boolean operators. [optional]
text string This parameter is used for finding stories whose title or body contains a specfic keyword. It supports boolean operators. [optional]
language string[] 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 string[] 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]
published_at_start string 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]
published_at_end string 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]
categories_taxonomy string 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 string[] This parameter is used for finding stories by categories id. You can read more about working with categories here. [optional]
not_categories_id string[] This parameter is used for excluding stories by categories id. You can read more about working with categories here. [optional]
categories_level int[] This parameter is used for finding stories by categories level. You can read more about working with categories here. [optional]
not_categories_level int[] This parameter is used for excluding stories by categories level. You can read more about working with categories here. [optional]
entities_title_text string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string This parameter is used for finding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
not_sentiment_title_polarity string This parameter is used for excluding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
sentiment_body_polarity string This parameter is used for finding stories whose body sentiment is the specified value. [optional] [enum: positive, neutral, negative]
not_sentiment_body_polarity string 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 string[] 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 string[] 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 int[] This parameter is used for finding stories whose author id is the specified value. [optional]
not_author_id int[] This parameter is used for excluding stories whose author id is the specified value. [optional]
author_name string This parameter is used for finding stories whose author full name contains the specified value. [optional]
not_author_name string This parameter is used for excluding stories whose author full name contains the specified value. [optional]
source_id int[] This parameter is used for finding stories whose source id is the specified value. [optional]
not_source_id int[] This parameter is used for excluding stories whose source id is the specified value. [optional]
source_name string[] This parameter is used for finding stories whose source name contains the specified value. [optional]
not_source_name string[] This parameter is used for excluding stories whose source name contains the specified value. [optional]
source_domain string[] This parameter is used for finding stories whose source domain is the specified value. [optional]
not_source_domain string[] This parameter is used for excluding stories whose source domain is the specified value. [optional]
source_locations_country string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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 string[] 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]
interval_start int This parameter is used for setting the start data point of histogram intervals. [optional]
interval_end int This parameter is used for setting the end data point of histogram intervals. [optional]
interval_width int This parameter is used for setting the width of histogram intervals. [optional]
field string This parameter is used for specifying the y-axis variable for the histogram. [optional] [default to social_shares_count] [enum: social_shares_count, social_shares_count.facebook, social_shares_count.linkedin, social_shares_count.reddit, social_shares_count.google_plus, characters_count, words_count, sentences_count, paragraphs_count, media.images.count, media.videos.count, source.links_in_count, source.rankings.alexa.rank.COUNTRYCODE]

Return type

Histograms

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

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

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

$api_instance = new Aylien\NewsApi\Api\DefaultApi();


$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,
    'interval_start' => 2500,
    'interval_end' => 200000,
    'interval_width' => 2500,
    'field' => "social_shares_count"
);

try {
    $result = $api_instance->listHistograms($opts);
    print_r($result);
} catch (Exception $e) {
    print_r($e->getResponseObject()->getErrors());
    echo 'Exception when calling DefaultApi->listHistograms: ', $e->getMessage(), PHP_EOL;
}
?>