Skip to main content

AYLIEN News API Client Library for Python

Project description

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. If you haven’t already done so, you will need to sign up.

Visit our interactive documentation to familiarize yourself with the API.

Requirements.

Python 2.7 and 3.4+

Installation & Usage

PyPI

Install it directly from PyPI repository:

pip install aylien_news_api

(or sudo pip install aylien_news_api to install the package for all users)

Git

Install it via:

pip install git+https://github.com/AYLIEN/aylien_newsapi_python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/AYLIEN/aylien_newsapi_python.git)

Then import the package:

import aylien_news_api

Getting Started

Please follow the installation procedure and then run the following:

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)

Documentation for API Endpoints

All URIs are relative to *https://api.newsapi.aylien.com/api/v1*

Class

Method

HTTP request

Description

DefaultApi

**list_autocompletes**

GET /autocompletes

List autocompletes

DefaultApi

**list_coverages**

POST /coverages

List coverages

DefaultApi

**list_histograms**

GET /histograms

List histograms

DefaultApi

**list_related_stories**

POST /related_stories

List related stories

DefaultApi

**list_stories**

GET /stories

List Stories

DefaultApi

**list_time_series**

GET /time_series

List time series

DefaultApi

**list_trends**

GET /trends

List trends

Documentation For Models

Documentation For Authorization

app_id

  • Type: API key

  • API key parameter name: X-AYLIEN-NewsAPI-Application-ID

  • Location: HTTP header

app_key

  • Type: API key

  • API key parameter name: X-AYLIEN-NewsAPI-Application-Key

  • Location: HTTP header

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aylien_news_api-0.1.1.tar.gz (35.8 kB view details)

Uploaded Source

File details

Details for the file aylien_news_api-0.1.1.tar.gz.

File metadata

File hashes

Hashes for aylien_news_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2834835fd72d1c8030d085c19397c261547256036b71a76731b0bcde5933ee65
MD5 0c7d775283abec8693949f2082d6f79c
BLAKE2b-256 94566fa01e6f62ce0116e12be9d203413117f52665066ad884466061181179c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page