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.0.tar.gz (35.8 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for aylien_news_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 336e73d9f97e210055e5caee21a79e266dd02968634b5a9d11c01f5cf8501a6b
MD5 06182a774aaf488fe91142d940b94f6a
BLAKE2b-256 d431832cccb76e133dcf56b4a76c33c12fc793c1183d5212e7d75c2cb4c024ad

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