openapi: 3.1.0
info:
title: quick-start-api-formerly-get-api Articles API
version: '1'
servers:
- url: https://api.newswhip.com/v1
tags:
- name: Articles
paths:
/articles:
post:
summary: /articles
description: ''
operationId: articles
parameters:
- name: key
in: query
description: Your API key.
required: true
schema:
type: string
default: DevHub
requestBody:
content:
application/json:
schema:
type: object
required:
- filters
properties:
filters:
type: array
description: See the Notes section at the bottom of this page. The _Lucene query strings_ section shares important considerations, including the limits to the number of filters that are allowed.
items:
type: string
from:
type: integer
description: Unix timestamp in milliseconds. Filters articles published after {from}. Defaults to a week ago.
default: null
format: int64
to:
type: integer
description: Unix timestamp in milliseconds. Filters articles published before {to}. Defaults to now.
default: null
format: int64
language:
type: string
description: Two letter ISO 639-1 language code. Defaults to any language.
default: en
sort_by:
type: string
description: See notes below.
default: default
video_only:
type: boolean
description: Ignored when searching by the content_type youtube. Defaults to false.
default: false
default_fields:
type: array
description: Up to 3 available fields to be used filtering only by keywords (like "Barack Obama"). Defaults to `headline`, `summary`, and `authors`.
default:
- headline
- summary
- authors
items:
type: string
size:
type: integer
description: Max number of articles to be returned (includes relatedStories). Defaults to 200. The maximum you can specify is 5,000.
default: 5
format: int32
find_related:
type: boolean
description: Related stories will be collapsed when set. Ignored when searching by the content_type youtube. Defaults to `true`.
default: true
content_type:
type: string
description: Filter by `stories` or `youtube`. Defaults to `stories`.
search_full_text:
type: boolean
description: If you want to search the full article text, set this to true. Defaults to `false`.
default: false
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"total_match\":15602,\n \"articles\": [\n {\n \"delta_time\": 548,\n \"recent_fb_counts\": 54761,\n \"recent_tw_counts\": 0,\n \"relatedStories\": [],\n \"fb_data\": {\n \"total_engagement_count\": 1096120,\n \"total_count_delta\": 54761,\n \"delta_period\": 548,\n \"delta_period_unit\": \"m\",\n \"fb_overperforming\": 26.570010165941973\n },\n \"tw_data\": {\n \"tw_count\": 0,\n \"total_count_delta\": 0,\n \"delta_period\": 548,\n \"delta_period_unit\": \"m\"\n },\n \"li_data\": {\n \"li_count\": 0,\n \"total_count_delta\": 0,\n \"delta_period\": 548,\n \"delta_period_unit\": \"m\"\n },\n \"pi_data\": {\n \"pi_count\": 2,\n \"delta_period\": 548,\n \"delta_period_unit\": \"m\"\n },\n \"predicted_interactions\": 1281202,\n \"predicted_timestamp\": 1522319800242,\n \"uuid\": \"3c75f3a0-309a-11e8-a52e-a128b18e226e\",\n \"publication_timestamp\": 1521989222000,\n \"link\": \"https://viralhatch.com/index.php/2018/03/25/90-have-no-idea-what-this-is-do-you-share-if-you-do/\",\n \"headline\": \"90% Have No Idea What This Is. Do You? SHARE if you do..\",\n \"excerpt\": \"Have you ever seen one of these?\",\n \"keywords\": \"\",\n \"source\": {\n \"publisher\": \"viralhatch.com\",\n \"domain\": \"viralhatch.com\",\n \"link\": \"https://viralhatch.com\",\n \"country\": \"United States\",\n \"country_code\": \"us\",\n \"language\": \"en\" \n },\n \"image_link\": \"https://viralhatch.com/wp-content/uploads/2018/03/ghght.jpg\",\n \"has_video\": false,\n \"nw_score\": 532.8919847752009,\n \"max_nw_score\": 5263.7731261133695,\n \"topics\": [],\n \"authors\": null,\n \"entities\": []\n }\n ]\n}"
schema:
type: object
properties:
total_match:
type: integer
example: 15602
default: 0
articles:
type: array
items:
type: object
properties:
delta_time:
type: integer
example: 548
default: 0
recent_fb_counts:
type: integer
example: 54761
default: 0
recent_tw_counts:
type: integer
example: 0
default: 0
relatedStories:
type: array
fb_data:
type: object
properties:
total_engagement_count:
type: integer
example: 1096120
default: 0
total_count_delta:
type: integer
example: 54761
default: 0
delta_period:
type: integer
example: 548
default: 0
delta_period_unit:
type: string
example: m
fb_overperforming:
type: number
example: 26.570010165941973
default: 0
tw_data:
type: object
properties:
tw_count:
type: integer
example: 0
default: 0
total_count_delta:
type: integer
example: 0
default: 0
delta_period:
type: integer
example: 548
default: 0
delta_period_unit:
type: string
example: m
li_data:
type: object
properties:
li_count:
type: integer
example: 0
default: 0
total_count_delta:
type: integer
example: 0
default: 0
delta_period:
type: integer
example: 548
default: 0
delta_period_unit:
type: string
example: m
pi_data:
type: object
properties:
pi_count:
type: integer
example: 2
default: 0
delta_period:
type: integer
example: 548
default: 0
delta_period_unit:
type: string
example: m
predicted_interactions:
type: integer
example: 1281202
default: 0
predicted_timestamp:
type: integer
example: 1522319800242
default: 0
uuid:
type: string
example: 3c75f3a0-309a-11e8-a52e-a128b18e226e
publication_timestamp:
type: integer
example: 1521989222000
default: 0
link:
type: string
example: https://viralhatch.com/index.php/2018/03/25/90-have-no-idea-what-this-is-do-you-share-if-you-do/
headline:
type: string
example: 90% Have No Idea What This Is. Do You? SHARE if you do..
excerpt:
type: string
example: Have you ever seen one of these?
keywords:
type: string
example: ''
source:
type: object
properties:
publisher:
type: string
example: viralhatch.com
domain:
type: string
example: viralhatch.com
link:
type: string
example: https://viralhatch.com
country:
type: string
example: United States
country_code:
type: string
example: us
language:
type: string
example: en
image_link:
type: string
example: https://viralhatch.com/wp-content/uploads/2018/03/ghght.jpg
has_video:
type: boolean
example: false
default: true
nw_score:
type: number
example: 532.8919847752009
default: 0
max_nw_score:
type: number
example: 5263.7731261133695
default: 0
topics:
type: array
authors: {}
entities:
type: array
'400':
description: '400'
content:
application/json:
examples:
Result:
value: "{\n \"error\": {\n \"message\": \"Fields 'foo' is not allowed for filters query!\",\n \"id\": \"6958f453-0acd-4c59-9f68-d82b42daa9f3\"\n }\n}"
schema:
type: object
properties:
error:
type: object
properties:
message:
type: string
example: Fields 'foo' is not allowed for filters query!
id:
type: string
example: 6958f453-0acd-4c59-9f68-d82b42daa9f3
deprecated: false
security: []
x-readme:
code-samples:
- language: curl
code: "curl -H \"Content-Type: application/json\" -X POST -d '{\n \"filters\": [\"country_code:(us OR gb) AND -publisher:youtube.com AND headline:rihanna\"],\n \"language\": \"en\",\n \"video_only\":false,\n \"sort_by\": \"nw_max_score\",\n \"find_related\": false,\n \"size\": 1\n}' \"https://api.newswhip.com/v1/articles?key=DevHub\""
samples-languages:
- curl
tags:
- Articles
components:
securitySchemes:
sec0:
type: apiKey
in: query
name: key
x-default: DevKey