-
Notifications
You must be signed in to change notification settings - Fork 0
/
Weather-API-Documentation.yaml
379 lines (379 loc) · 14.8 KB
/
Weather-API-Documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
openapi: 3.1.0
info:
title: Weather API Documentation
version: '2.5'
description: 'This API gives access to current weather, minute forecast for 1 hour, hourly forecast for 48 hours, daily forecast for 7 days and government weather alerts. Helpful stats, graphics, and this day in history charts are available for your reference. Interactive maps show precipitation, clouds, pressure, wind around your location stations. Data is available in JSON, XML, or HTML format'
license:
name: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
url: 'https://creativecommons.org/licenses/by-sa/4.0/'
summary: 'This API gives access to current weather, minute forecast for 1 hour, hourly forecast for 48 hours, daily forecast for 7 days and government weather alerts. Helpful stats, graphics, and this day in history charts are available for your reference. Interactive maps show precipitation, clouds, pressure, wind around your location stations. Data is available in JSON, XML, or HTML format'
servers:
- url: 'https://api.openweathermap.org/data/2.5'
description: pro
paths:
/weather:
get:
summary: GET endpoint
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
x-examples:
example-1:
coord:
lon: -121.95
lat: 37.35
weather:
- id: 803
main: Clouds
description: broken clouds
icon: 04n
base: stations
main:
temp: 45.25
feels_like: 41.16
temp_min: 41
temp_max: 50
pressure: 1026
humidity: 75
visibility: 16093
wind:
speed: 2.57
deg: 36
clouds:
all: 75
dt: 1579415808
sys:
type: 1
id: 5845
country: US
sunrise: 1579360793
sunset: 1579396557
timezone: -28800
id: 0
name: Santa Clara
cod: 200
properties:
coord:
type: object
required:
- lon
- lat
properties:
lon:
type: number
description: |
City geo location, longitude
example: 145.77
lat:
type: number
description: 'City geo location, latitude'
example: -16.92
weather:
type: array
uniqueItems: true
minItems: 1
description: Weather Condition
items:
type: object
properties:
id:
type: number
description: Weather Condition id
example: 803
main:
type: string
minLength: 1
description: ' ‘Group of weather parameters (Rain, Snow, Extreme etc.)’'
example: cloud
description:
type: string
minLength: 1
description: Weather condition within the group
example: broken clouds
icon:
type: string
minLength: 1
description: weather icon id
example: 04n
required:
- id
- main
- description
- icon
base:
type: string
minLength: 1
description: Internal parameter
example: cmc stations
main:
type: object
required:
- temp
- feels_like
- temp_min
- temp_max
- pressure
- humidity
properties:
temp:
type: number
description: '‘Temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.’'
example: 296.4
feels_like:
type: number
description: What the weather feels like despite the actual numbers
example: 24.9
temp_min:
type: number
description: ' ‘Minimum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.’'
example: 276.9
temp_max:
type: number
description: ' ‘Maximum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.’'
example: 290.6
pressure:
type: number
description: ' ‘Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa’'
example: 1019
humidity:
type: number
description: ' ‘Humidity, %’'
example: 79
visibility:
type: number
description: '‘Visibility, meter’'
example: 16201
wind:
type: object
required:
- speed
- deg
properties:
speed:
type: number
description: ' ‘Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.’'
example: 4.9
deg:
type: number
description: ' ‘’'
example: 145
clouds:
type: object
required:
- all
properties:
all:
type: number
description: ' ‘Cloudiness, %’'
example: 71
dt:
type: number
description: '‘Time of data calculation, unix, UTC’'
example: 1435658272
sys:
type: object
required:
- type
- id
- country
- sunrise
- sunset
properties:
type:
type: number
description: ' Internal parameter'
example: 1
id:
type: number
description: ' Internal parameter'
example: 7990
country:
type: string
minLength: 1
description: ' ‘Country code (GB, JP etc.)’'
example: AU
sunrise:
type: number
description: ' ‘Sunrise time, unix, UTC’'
example: 1435610796
sunset:
type: number
description: ' ‘Sunset time, unix, UTC’'
example: 1435650870
timezone:
type: number
description: the timezone for the station
example: -28800
id:
type: number
description: City ID
example: 2172797
name:
type: string
minLength: 1
description: Name
example: Tom
cod:
type: number
description: ' Internal parameter'
example: 200
required:
- coord
- weather
- base
- main
- visibility
- wind
- clouds
- dt
- sys
- timezone
- id
- name
- cod
operationId: get-weather
description: ' Access current weather data for any location on Earth including over 200,000 cities! Current weather is frequently updated based on global models and data from more than 40,000 weather stations.'
parameters:
- schema:
type: string
enum:
- standard
- metric
- imperial
in: query
name: Zip
description: '**Zip code**. Search by zip code. *Example: 95050,us*. Please note that if the country is not specified, the search uses USA as a default.'
- schema:
type: number
in: query
name: units
description: '**Units**. *Example: imperial*. Possible values: `standard`, `metric`, and `imperial`. When you do not use the `units` parameter, the format is `standard` by default.'
- schema:
type: string
in: query
name: q
description: '**City name**. *Example: London*. You can call by city name, or by city name and country code. The API responds with a list of results that match a searching word. For the query value, type the city name and optionally the country code divided by a comma; use ISO 3166 country codes'
- schema:
type: string
in: query
name: id
description: '**City ID**. *Example: `2172797`*. You can call by city ID. The API responds with the exact result. The List of city IDs can be downloaded [here](http://bulk.openweathermap.org/sample/). You can include multiple cities in this parameter — just separate them by commas. The limit of locations is 20. *Note: A single ID counts as a one API call. So, if you have city IDs, it’s treated as 3 API calls.*'
- schema:
type: string
in: query
name: lat
description: '**Latitude**. *Example: 35*. The latitude coordinate of the location of your interest. Must use with `lon`.'
- $ref: '#/components/parameters/lon'
- schema:
type: string
default: en
enum:
- “ar
- bg
- ca
- cz
- de
- el
- en
- fa
- fi
- fr
- gl
- hr
- hu
- it
- ja
- kr
- la
- lt
- mk
- nl
- pl
- pt
- ro
- ru
- se
- sk
- sl
- es
- tr
- ua
- vi
- zh_cn
- zh_tw”
in: query
name: lang
description: '**Language**. *Example: en*. You can use lang parameter to get the output in your language. We support the following languages that you can use with the corresponded lang values: Arabic - `ar`, Bulgarian - `bg`, Catalan - `ca`, Czech - `cz`, German - `de`, Greek - `el`, English - `en`, Persian (Farsi) - `fa`, Finnish - `fi`, French - `fr`, Galician - `gl`, Croatian - `hr`, Hungarian - `hu`, Italian - `it`, Japanese - `ja`, Korean - `kr`, Latvian - `la`, Lithuanian - `lt`, Macedonian - `mk`, Dutch - `nl`, Polish - `pl`, Portuguese - `pt`, Romanian - `ro`, Russian - `ru`, Swedish - `se`, Slovak - `sk`, Slovenian - `sl`, Spanish - `es`, Turkish - `tr`, Ukrainian - `ua`, Vietnamese - `vi`, Chinese Simplified - `zh_cn`, Chinese Traditional - `zh_tw`.'
- schema:
type: string
default: json
enum:
- json
- xml
- html
in: query
name: mode
description: '**Mode*. *Example: html. Determines the format of the response. Possible values are `json`, `xml`, and `html`. If the mode parameter is empty, the format is `json` by default.'
parameters: []
components:
schemas:
User:
title: User
type: object
description: ''
examples:
- id: 142
firstName: Alice
lastName: Smith
email: [email protected]
dateOfBirth: '1997-10-31'
emailVerified: true
signUpDate: '2019-08-24'
properties:
id:
type: integer
description: Unique identifier for the given user.
firstName:
type: string
lastName:
type: string
email:
type: string
format: email
dateOfBirth:
type: string
format: date
example: '1997-10-31'
emailVerified:
type: boolean
description: Set to true if the user's email has been verified.
createDate:
type: string
format: date
description: The date that the user was created.
required:
- id
- firstName
- lastName
- email
- emailVerified
parameters:
lon:
name: lon
in: query
required: false
schema:
type: string
description: '**Longitude**. *Example: 139*. Longitude coordinate of the location of your interest. Must use with `lat `.'
securitySchemes:
' app_id':
name: appid
type: apiKey
in: query
security:
- ' app_id': []