Created
December 3, 2020 17:27
-
-
Save Exey/f2e08891ce5fdda948decba0f61f6f24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.3 | |
info: | |
title: NewsAPI | |
description: NewsAPI.org | |
version: 1.0.0 | |
servers: | |
- url: https://newsapi.org/v2 | |
tags: | |
- name: articles | |
description: News articles | |
paths: | |
/everything/: | |
get: | |
tags: | |
- articles | |
summary: News List | |
operationId: everythingGet | |
parameters: | |
- name: q | |
in: query | |
description: Theme of news | |
required: true | |
schema: | |
type: string | |
- name: from | |
in: query | |
description: date | |
required: true | |
schema: | |
type: string | |
- name: sortBy | |
in: query | |
description: Sort | |
required: true | |
schema: | |
type: string | |
- name: language | |
in: query | |
description: Language in two letters | |
required: true | |
schema: | |
type: string | |
- name: apiKey | |
in: query | |
description: API key | |
required: true | |
schema: | |
type: string | |
- name: page | |
in: query | |
description: number of page | |
schema: | |
type: integer | |
responses: | |
200: | |
description: success | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ArticleList' | |
default: | |
description: enexpected error | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ErrorModel' | |
components: | |
schemas: | |
ErrorModel: | |
type: object | |
required: | |
- message | |
- code | |
properties: | |
message: | |
type: string | |
code: | |
type: integer | |
minimum: 100 | |
maximum: 600 | |
ArticleList: | |
type: object | |
properties: | |
status: | |
type: string | |
totalResults: | |
type: integer | |
articles: | |
type: array | |
items: | |
$ref: '#/components/schemas/Article' | |
Article: | |
type: object | |
properties: | |
source: | |
$ref: '#/components/schemas/Source' | |
author: | |
type: string | |
title: | |
type: string | |
description: | |
type: string | |
url: | |
type: string | |
urlToImage: | |
type: string | |
publishedAt: | |
type: string | |
content: | |
type: string | |
required: | |
- title | |
Source: | |
type: object | |
properties: | |
id: | |
type: string | |
name: | |
type: string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment