· 6 years ago · Dec 12, 2019, 06:06 PM
1openapi: 3.0.1
2info:
3 title: NewsAPI
4 description: NewsAPI.org
5 version: 1.0.0
6servers:
7- url: https://newsapi.org/v2
8tags:
9 - name: articles
10 description: News articles
11paths:
12 /everything/:
13 get:
14 tags:
15 - articles
16 summary: News List
17 operationId: everythingGet
18 parameters:
19 - name: q
20 in: query
21 description: Theme of news
22 required: true
23 schema:
24 type: string
25 - name: from
26 in: query
27 description: date
28 required: true
29 schema:
30 type: string
31 - name: sortBy
32 in: query
33 description: Sort
34 required: true
35 schema:
36 type: string
37 - name: apiKey
38 in: query
39 description: API key
40 required: true
41 schema:
42 type: string
43 responses:
44 200:
45 description: success
46 content:
47 application/json:
48 schema:
49 $ref: '#/components/schemas/ArticleList'
50 default:
51 description: enexpected error
52 content:
53 application/json:
54 schema:
55 $ref: '#/components/schemas/ErrorModel'
56components:
57 schemas:
58 ErrorModel:
59 type: object
60 required:
61 - message
62 - code
63 properties:
64 message:
65 type: string
66 code:
67 type: integer
68 minimum: 100
69 maximum: 600
70 ArticleList:
71 type: object
72 properties:
73 status:
74 type: string
75 totalResults:
76 type: integer
77 articles:
78 type: array
79 items:
80 $ref: '#/components/schemas/Article'
81 Article:
82 type: object
83 properties:
84 source:
85 $ref: '#/components/schemas/Source'
86 author:
87 type: string
88 title:
89 type: string
90 description:
91 type: string
92 url:
93 type: string
94 urlToImage:
95 type: string
96 publishedAt:
97 type: string
98 content:
99 type: string
100 Source:
101 type: object
102 properties:
103 id:
104 type: string
105 name:
106 type: string