About

The trends endpoint allows you to identify the most-mentioned entities, concepts and keywords relevant to your query. For example, this endpoint allows you to set parameters like a time period, a subject category, or an entity, and your request will return the most mentioned entities or keywords that are mentioned in relation to your query.

Parameters

Name Type Description Notes
field string This parameter is used to specify the trend field. [enum: author.name, source.name, source.domain, keywords, entities.title.text, entities.title.type, entities.title.links.dbpedia, entities.body.text, entities.body.type, entities.body.links.dbpedia, hashtags, categories.id, sentiment.title.polarity, sentiment.body.polarity]
id List<long?> This parameter is used for finding stories by story id. [optional]
notId List<long?> 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 List<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]
notLanguage List<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]
publishedAtStart 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]
publishedAtEnd 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]
categoriesTaxonomy 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]
categoriesConfident 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]
categoriesId List<string> This parameter is used for finding stories by categories id. You can read more about working with categories here. [optional]
notCategoriesId List<string> This parameter is used for excluding stories by categories id. You can read more about working with categories here. [optional]
categoriesLevel List<int?> This parameter is used for finding stories by categories level. You can read more about working with categories here. [optional]
notCategoriesLevel List<int?> This parameter is used for excluding stories by categories level. You can read more about working with categories here. [optional]
entitiesTitleText List<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]
notEntitiesTitleText List<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]
entitiesTitleType List<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]
notEntitiesTitleType List<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]
entitiesTitleLinksDbpedia List<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]
notEntitiesTitleLinksDbpedia List<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]
entitiesBodyText List<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]
notEntitiesBodyText List<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]
entitiesBodyType List<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]
notEntitiesBodyType List<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]
entitiesBodyLinksDbpedia List<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]
notEntitiesBodyLinksDbpedia List<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]
sentimentTitlePolarity string This parameter is used for finding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
notSentimentTitlePolarity string This parameter is used for excluding stories whose title sentiment is the specified value. [optional] [enum: positive, neutral, negative]
sentimentBodyPolarity string This parameter is used for finding stories whose body sentiment is the specified value. [optional] [enum: positive, neutral, negative]
notSentimentBodyPolarity string This parameter is used for excluding stories whose body sentiment is the specified value. [optional] [enum: positive, neutral, negative]
mediaImagesCountMin int? This parameter is used for finding stories whose number of images is greater than or equal to the specified value. [optional]
mediaImagesCountMax int? This parameter is used for finding stories whose number of images is less than or equal to the specified value. [optional]
mediaImagesWidthMin int? This parameter is used for finding stories whose width of images are greater than or equal to the specified value. [optional]
mediaImagesWidthMax int? This parameter is used for finding stories whose width of images are less than or equal to the specified value. [optional]
mediaImagesHeightMin int? This parameter is used for finding stories whose height of images are greater than or equal to the specified value. [optional]
mediaImagesHeightMax int? This parameter is used for finding stories whose height of images are less than or equal to the specified value. [optional]
mediaImagesContentLengthMin int? This parameter is used for finding stories whose images content length are greater than or equal to the specified value. [optional]
mediaImagesContentLengthMax int? This parameter is used for finding stories whose images content length are less than or equal to the specified value. [optional]
mediaImagesFormat List<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]
notMediaImagesFormat List<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]
mediaVideosCountMin int? This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. [optional]
mediaVideosCountMax int? This parameter is used for finding stories whose number of videos is less than or equal to the specified value. [optional]
authorId List<int?> This parameter is used for finding stories whose author id is the specified value. [optional]
notAuthorId List<int?> This parameter is used for excluding stories whose author id is the specified value. [optional]
authorName string This parameter is used for finding stories whose author full name contains the specified value. [optional]
notAuthorName string This parameter is used for excluding stories whose author full name contains the specified value. [optional]
sourceId List<int?> This parameter is used for finding stories whose source id is the specified value. [optional]
notSourceId List<int?> This parameter is used for excluding stories whose source id is the specified value. [optional]
sourceName List<string> This parameter is used for finding stories whose source name contains the specified value. [optional]
notSourceName List<string> This parameter is used for excluding stories whose source name contains the specified value. [optional]
sourceDomain List<string> This parameter is used for finding stories whose source domain is the specified value. [optional]
notSourceDomain List<string> This parameter is used for excluding stories whose source domain is the specified value. [optional]
sourceLocationsCountry List<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]
notSourceLocationsCountry List<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]
sourceLocationsState List<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]
notSourceLocationsState List<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]
sourceLocationsCity List<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]
notSourceLocationsCity List<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]
sourceScopesCountry List<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]
notSourceScopesCountry List<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]
sourceScopesState List<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]
notSourceScopesState List<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]
sourceScopesCity List<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]
notSourceScopesCity List<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]
sourceScopesLevel List<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]
notSourceScopesLevel List<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]
sourceLinksInCountMin 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]
sourceLinksInCountMax 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]
sourceRankingsAlexaRankMin 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]
sourceRankingsAlexaRankMax 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]
sourceRankingsAlexaCountry List<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]
socialSharesCountFacebookMin int? This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. [optional]
socialSharesCountFacebookMax int? This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. [optional]
socialSharesCountGooglePlusMin int? This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. [optional]
socialSharesCountGooglePlusMax int? This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. [optional]
socialSharesCountLinkedinMin int? This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. [optional]
socialSharesCountLinkedinMax int? This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. [optional]
socialSharesCountRedditMin int? This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. [optional]
socialSharesCountRedditMax int? This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. [optional]

Return type

Trends

Example

using System;
using System.Diagnostics;
using Aylien.NewsApi.Api;
using Aylien.NewsApi.Client;
using Aylien.NewsApi.Model;
using System.Collections.Generic;

namespace Example
{
    public class ListTrendsExample
    {
        static void Main(string[] args)
        {
            // Configure API key authorization: app_id
            Configuration.Default.ApiKey.Add("X-AYLIEN-NewsAPI-Application-ID", "YOUR_APP_ID");

            // Configure API key authorization: app_key
            Configuration.Default.ApiKey.Add("X-AYLIEN-NewsAPI-Application-Key", "YOUR_APP_KEY");

            var apiInstance = new DefaultApi();

            var field = "keywords";
            var id = new List<long?>() { 54121 };
            var notId = new List<long?>() { 21451 };
            var title = "startup AND (raise OR raised OR raising OR raises)";
            var body = "startup";
            var text = "startup company";
            var language = new List<string>() { "en", "it" };
            var notLanguage = new List<string>() { "es", "pt" };
            var publishedAtStart = "NOW-10DAYS";
            var publishedAtEnd = "NOW";
            var categoriesTaxonomy = "iab-qag";
            var categoriesConfident = true;
            var categoriesId = new List<string>() { "IAB15" };
            var notCategoriesId = new List<string>() { "IAB2-3" };
            var categoriesLevel = new List<int?>() { 1 };
            var notCategoriesLevel = new List<int?>() { 2 };
            var entitiesTitleText = new List<string>() { "GNU/Linux", "Microsoft" };
            var notEntitiesTitleText = new List<string>() { "Windows" };
            var entitiesTitleType = new List<string>() { "Organization", "Software" };
            var notEntitiesTitleType = new List<string>() { "Person", "Agent" };
            var entitiesTitleLinksDbpedia = new List<string>() { "http://dbpedia.org/resource/Donald_Trump" };
            var notEntitiesTitleLinksDbpedia = new List<string>() { "http://dbpedia.org/resource/Linux" };
            var entitiesBodyText = new List<string>() { "GNU/Linux", "Apple" };
            var notEntitiesBodyText = new List<string>() { "Windows" };
            var entitiesBodyType = new List<string>() { "Person", "Agent" };
            var notEntitiesBodyType = new List<string>() { "Organization", "Software" };
            var entitiesBodyLinksDbpedia = new List<string>() { "http://dbpedia.org/resource/Windows" };
            var notEntitiesBodyLinksDbpedia = new List<string>() { "http://dbpedia.org/resource/Linux" };
            var sentimentTitlePolarity = "positive";
            var notSentimentTitlePolarity = "negative";
            var sentimentBodyPolarity = "neutral";
            var notSentimentBodyPolarity = "negative";
            var mediaImagesCountMin = 2;
            var mediaImagesCountMax = 10;
            var mediaImagesWidthMin = 640;
            var mediaImagesWidthMax = 1024;
            var mediaImagesHeightMin = 480;
            var mediaImagesHeightMax = 800;
            var mediaImagesContentLengthMin = 25411;
            var mediaImagesContentLengthMax = 369541;
            var mediaImagesFormat = new List<string>() { "JPEG", "BMP", "GIF" };
            var notMediaImagesFormat = new List<string>() { "PNG", "TIFF" };
            var mediaVideosCountMin = 1;
            var mediaVideosCountMax = 4;
            var authorId = new List<int?>() { 2154 };
            var notAuthorId = new List<int?>() { 5412 };
            var authorName = "John Doe";
            var notAuthorName = "Mike Wally";
            var sourceId = new List<int?>() { 1467 };
            var notSourceId = new List<int?>() { 1524 };
            var sourceName = new List<string>() { "BBC" };
            var notSourceName = new List<string>() { "Fox News" };
            var sourceDomain = new List<string>() { "bbc.co.uk" };
            var notSourceDomain = new List<string>() { "foxnews.com" };
            var sourceLocationsCountry = new List<string>() { "US", "IE" };
            var notSourceLocationsCountry = new List<string>() { "NG" };
            var sourceLocationsState = new List<string>() { "California" };
            var notSourceLocationsState = new List<string>() { "Arizona" };
            var sourceLocationsCity = new List<string>() { "Los Angeles" };
            var notSourceLocationsCity = new List<string>() { "New York City" };
            var sourceScopesCountry = new List<string>() { "NG", "IE" };
            var notSourceScopesCountry = new List<string>() { "US", "IR" };
            var sourceScopesState = new List<string>() { "Co Dublin" };
            var notSourceScopesState = new List<string>() { "Co Wicklow" };
            var sourceScopesCity = new List<string>() { "Dublin City" };
            var notSourceScopesCity = new List<string>() { "Cork" };
            var sourceScopesLevel = new List<string>() { "local" };
            var notSourceScopesLevel = new List<string>() { "national" };
            var sourceLinksInCountMin = 5000;
            var sourceLinksInCountMax = 10000;
            var sourceRankingsAlexaRankMin = 1;
            var sourceRankingsAlexaRankMax = 2000;
            var sourceRankingsAlexaCountry = new List<string>() { "IE" };
            var socialSharesCountFacebookMin = 3521;
            var socialSharesCountFacebookMax = 5841;
            var socialSharesCountGooglePlusMin = 251;
            var socialSharesCountGooglePlusMax = 6521;
            var socialSharesCountLinkedinMin = 4125;
            var socialSharesCountLinkedinMax = 15214;
            var socialSharesCountRedditMin = 1584;
            var socialSharesCountRedditMax = 95412;

            try
            {
                // List trends
                Trends result = apiInstance.ListTrends(
                    field: field,
                    id: id,
                    notId: notId,
                    title: title,
                    body: body,
                    text: text,
                    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
                );
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.ListTrends: " + e.Message);
            }
        }
    }
}