News API | Analyze News Content at Scale

News API

News Search and Analysis, Powered by Deep NLP

Search, source, and analyze news from around the web in real-time

Trusted By
The Easiest Way to Source, Collect, and Understand News Content at Scale

We monitor thousands of news outlets in real-time to give you an enriched and flexible news data feed.

hot stories about presidential elections sorted by recency

Search

Find the news stories that matter to you with advanced search features

Stream

Build real-time and historical feeds of news based on your search

Analyze

Our NLP models extract over 25 structured data points from every news article

Start Your 14 Day Trial Today
Sign Me Up
No credit card needed
Understanding Content at Scale Doesn’t Have to be Difficult

Stay ahead of the curve. Use the power of Machine Learning and NLP to understand content at scale while extracting the data that matters to you.

News Content
Advanced Search

Keywords & Entities
Topics
Locations
Source
Date

Trusted Sources

High-quality sources
Manually curated
Updated daily

Structured Data Extraction

Title and body
Author and publish date
Images and videos
JSON data feed

Efficient Content Sourcing

Real-time monitoring
Historical archive
No scraping
Reliable content feeds

News-driven Insights
Assess Media Reaction

Sentiment Analysis
Coverage monitoring
Trend analysis

Process Content

Spot spikes in interest
Build retrospective reports
Extract article summaries

Advanced Analytics Features

Clustering
Time series
Histograms
Trends

Engagement Metrics

Quantify social reach
Spot trending stories

Build Intelligent, News-Driven Content Solutions

Bring the power of Machine Learning and Natural Language Processing to whatever you’re building – in minutes rather than days.

Media Monitoring Solutions
Risk and Market Analysis Solutions
News Aggregation Apps
Content Discovery Tools
Business Intelligence Solutions
Event Detection Solutions
Built by Developers for Developers

Easy to use API that returns parsed and analyzed news articles as a rich JSON object.

Visit our GitHub page to download our Node.js SDK repo, or you can run an example with the code below:

Installation:

$ npm install aylien-news-api --save
                        

You can then import and initiate the SDK easily:

var AylienNewsApi = require('aylien-news-api');

var apiInstance = new AylienNewsApi.DefaultApi();

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

// Configure API key authorization: app_key
var app_key = apiInstance.apiClient.authentications['app_key'];
app_key.apiKey = "YOUR APP KEY";

var opts = {
    'title': 'trump',
    'sortBy': 'social_shares_count.facebook',
    'language': ['en'],
    'publishedAtStart': 'NOW-7DAYS',
    'publishedAtEnd': 'NOW',
    'entitiesBodyLinksDbpedia': [
        'http://dbpedia.org/resource/Donald_Trump',
        'http://dbpedia.org/resource/Hillary_Rodham_Clinton'
    ]
};

var callback = function(error, data, response) {
    if (error) {
    console.error(error);
    } else {
        console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listStories(opts, callback);
                        

Visit our GitHub page to download our Python SDK repo, or you can run an example with the code below:

Installation:

$ pip install aylien_news_api
                        

You can then import and initiate the SDK easily:

import aylien_news_api
from aylien_news_api.rest import ApiException

# 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()

title = 'trump'
sort_by = 'social_shares_count.facebook'
language = ['en']
since = 'NOW-7DAYS'
until = 'NOW'
entities = [
    'http://dbpedia.org/resource/Donald_Trump',
    'http://dbpedia.org/resource/Hillary_Rodham_Clinton'
]

try:
# List stories
api_response = api_instance.list_stories(title=title, language=language, published_at_start=since, published_at_end=until, entities_body_links_dbpedia=entities, sort_by=sort_by)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->list_stories: %s\n" % e)
                        

Visit our GitHub page to download our PHP SDK repo, or you can run an example with the code below:

Installation:

Simply add the following to your composer.json:

{
    "require": {
        "aylien/newsapi": "~1.0.0"
    }
}
                        

You can then import and initiate the SDK easily:

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(
    'title' => 'trump',
    'published_at_start' => 'NOW-7DAYS',
    'published_at_end' => 'NOW',
    'entities_body_links_dbpedia' => [
        'http://dbpedia.org/resource/Donald_Trump',
        'http://dbpedia.org/resource/Hillary_Rodham_Clinton'
    ],
    'language' => ['en'],
    'sort_by' => 'social_shares_count.facebook'
);

try {
    $result = $api_instance->listStories($opts);;
        print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listStories: ', $e->getMessage(), "\n";
}
                        

Visit our GitHub page to download our Ruby SDK repo, or you can run an example with the code below:

Installation:

$ gem install 'aylien_news_api'
                        

You can then import and initiate the SDK easily:

# 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 APP 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 = {
    :title => 'trump',
    :published_at_start => "NOW-7DAYS",
    :published_at_end => "NOW",
    :entities_body_links_dbpedia => [
        'http://dbpedia.org/resource/Donald_Trump',
        'http://dbpedia.org/resource/Hillary_Rodham_Clinton'
    ],
    :language => ['en'],
    :sort_by => 'social_shares_count.facebook'
}

begin
#List stories
result = api_instance.list_stories(opts)
puts result
rescue AylienNewsApi::ApiError => e
puts "Exception when calling DefaultApi->list_stories: #{e}"
end
                        

Visit our GitHub page to download our Java SDK repo, or you can run an example with the code below:

Installation:

Building the API client library requires Maven to be installed.

<‌dependency>
<‌groupId>com.aylien.newsapi<‌/groupId>
<‌artifactId>client<‌/artifactId>
<‌version>0.0.1<‌/version>
<‌scope>compile<‌/scope>
<‌/‌dependency>
                        

And for SBT users:

"com.aylien.newsapi" % "client" % "0.0.1"
                        

Example:

package com.aylien.newsapisample;

import com.aylien.newsapi.*;
import com.aylien.newsapi.auth.*;
import com.aylien.newsapi.models.*;
import com.aylien.newsapi.parameters.*;
import com.aylien.newsapi.api.DefaultApi;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // 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 APP KEY");

        DefaultApi apiInstance = new DefaultApi();

        StoriesParams.Builder storiesBuilder = StoriesParams.newBuilder();

        String title = "trump";
        String sortBy = "social_shares_count.facebook";
        List language = new ArrayList() {{
            add("en");
        }};
        String since = "NOW-7DAYS";
        String until = "NOW";
        List entities = new ArrayList() {{
            add("http://dbpedia.org/resource/Donald_Trump");
            add("http://dbpedia.org/resource/Hillary_Rodham_Clinton");
        }};

        storiesBuilder.setTitle(title);
        storiesBuilder.setSortBy(sortBy);
        storiesBuilder.setLanguage(language);
        storiesBuilder.setPublishedAtStart(since);
        storiesBuilder.setPublishedAtEnd(until);
        storiesBuilder.setEntitiesBodyLinksDbpedia(entities);

        try {
            Stories result = apiInstance.listStories(storiesBuilder.build());
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#listStories");
            e.printStackTrace();
        }
    }
}
                        

Visit our GitHub page to download our Go SDK repo, or you can run an example with the code below:

Installation:

$ go get github.com/AYLIEN/aylien_newsapi_go
                        

You can then import and initiate the SDK easily:

package main

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

func main() {
    api := newsapi.NewDefaultApi()

    // Configure API key authorization: app_id
    api.Configuration.APIKeyPrefix["X-AYLIEN-NewsAPI-Application-ID"] = "YOUR APP ID"

    // Configure API key authorization: app_key
    api.Configuration.APIKeyPrefix["X-AYLIEN-NewsAPI-Application-Key"] = "YOUR APP KEY"

    title := "trump"
    until := "NOW"
    since := "NOW-7DAYS"
    sortBy := "social_shares_count.facebook"
    language := []string{"en"}
    entities := []string{
        "http://dbpedia.org/resource/Donald_Trump",
        "http://dbpedia.org/resource/Hillary_Rodham_Clinton",
    }

    storiesParams := &newsapi.StoriesParams{
        Title:                    title,
        Language:                 language,
        PublishedAtStart:         since,
        PublishedAtEnd:           until,
        EntitiesBodyLinksDbpedia: entities,
        SortBy: sortBy}

    storiesResponse, res, err := api.ListStories(storiesParams)
    if err != nil {
        panic(err)
    }
    _ = res

    fmt.Println(storiesResponse)
}
                        

Visit our GitHub page to download our C# SDK repo, or you can run an example with the code below:

Installation:

The easiest way to get the C# SDK is to use NuGet.

PM> Install-Package Aylien.NewsApi
                        

You can then import and initiate the SDK easily:

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 Example
    {
        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();

            string title = "trump";
            string since = "NOW-7DAYS";
            string until = "NOW";
            string sortBy = "social_shares_count.facebook";
            List<‌String> language = new List<‌String> { "en" };
            List<‌String> entities = new List<‌String> {
                "http://dbpedia.org/resource/Donald_Trump",
                "http://dbpedia.org/resource/Hillary_Rodham_Clinton"
            };

            try
            {
                // List stories
                Stories result = apiInstance.ListStories(title: title, publishedAtStart: since, publishedAtEnd: until, language: language, entitiesBodyLinksDbpedia: entities, sortBy: sortBy);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.ListStories: " + e.Message );
            }
        }
    }
}
                        
Ready to Get Started?

Start your 14-day trial today! Paid plans start from $49 per month.