generated from readthedocs/tutorial-template
-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
PW_OpenAPI.yaml
792 lines (791 loc) · 30.4 KB
/
PW_OpenAPI.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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
openapi: 3.0.0
info:
version: 2.0.11
title: Pirate Weather API
description: Pirate Weather provides an open, free, and documented source of government weather data.
termsOfService: https://pirate-weather.apiable.io/terms
contact:
email: mail@pirateweather.net
license:
name: Apache License 2.0
url: https://github.com/alexander0042/pirateweather/blob/main/LICENSE
externalDocs:
description: Full API reference
url: https://pirate-weather.apiable.io/full-api-reference
tags:
- name: Weather
description: Pirate Weather provides an open, free, and documented source of government weather data.
paths:
"/forecast/{api_key}/{lat_and_long_or_time}":
get:
tags:
- Weather
operationId: Weather
summary: Make a request to Pirate Weather
description: Fetch a weather forecast or get historical weather data based on input latitude and longitude.
parameters:
- name: api_key
in: path
description: Pirate Weather Authentication Token.
required: true
schema:
type: string
- name: lat_and_long_or_time
in: path
description: A single comma-delimited string containing Latitude and Longitude information. Optionally, either a UNIX timestamp, ISO 8601 date string, or number of seconds before present can be added.
required: true
schema:
type: string
- name: exclude
in: query
description: Exclude some keys from the Pirate Weather forecast response.
schema:
type: string
- name: extend
in: query
description: Fetch the next 168 hours (7 days) worth of hourly data, instead of the next 24.
schema:
type: string
- name: lang
in: query
description: Not presently implemented. Change the forecast language.
schema:
type: string
- name: units
in: query
description: Return the weather forecast data in the requested unit system.
schema:
type: string
- name: version
in: query
description: Include fields which were not part of the Dark Sky API but were introduced in API version 2.
schema:
type: integer
responses:
"200":
description: Success
content:
"*/*":
schema:
properties:
latitude:
$ref: "#/components/schemas/latitude"
longitude:
$ref: "#/components/schemas/longitude"
timezone:
$ref: "#/components/schemas/timezone"
offset:
$ref: "#/components/schemas/offset"
elevation:
$ref: "#/components/schemas/elevation"
currently:
$ref: "#/components/schemas/currently"
minutely:
$ref: "#/components/schemas/minutely"
hourly:
$ref: "#/components/schemas/hourly"
daily:
$ref: "#/components/schemas/daily"
alerts:
$ref: "#/components/schemas/alerts"
flags:
$ref: "#/components/schemas/flags"
servers:
- url: https://api.pirateweather.net
description: Production forecast data server
- url: https://dev.pirateweather.net
description: Development forecast data server
- url: https://timemachine.pirateweather.net
description: Production historic data server
components:
schemas:
latitude:
type: number
description: The requested latitude.
example: 37.3034933
longitude:
type: number
description: The requested longitude.
example: -89.5230357
timezone:
type: string
description: The timezone name for the requested location.
example: America/Chicago
offset:
type: integer
format: int32
description: The timezone offset in hours.
example: -6
elevation:
type: integer
format: int32
description: The elevation in meters of the forecast point.
example: 344
currently:
type: object
description: A block containing the current weather for the requested location.
properties:
time:
type: integer
format: int32
description: The current time in UNIX format.
example: 1677876000
summary:
type: string
description: A human-readable summary of the current weather.
example: Windy
icon:
type: string
description: An icon representing the current weather.
example: wind
nearestStormDistance:
type: number
description: The distance to the nearest storm in kilometers.
example: 125.39
nearestStormBearing:
type: integer
format: int32
description: The direction to the nearest storm in degrees.
example: 27
precipIntensity:
type: number
description: The intensity of precipitation in millimeters per hour.
example: 0
precipProbability:
type: number
description: The probability of precipitation occurring.
example: 0
precipIntensityError:
type: number
description: The standard deviation of the precipitation intensity.
example: 0
precipType:
type: string
description: The type of precipitation occurring.
example: none
temperature:
type: number
description: The air temperature.
example: 44.44
apparentTemperature:
type: number
description: The apparent temperature (feels like).
example: 35.74
dewPoint:
type: number
description: The dew point temperature.
example: 39.61
humidity:
type: number
description: The relative humidity.
example: 0.83
pressure:
type: number
description: The sea-level pressure in hectopascals.
example: 981.5
windSpeed:
type: number
description: The wind speed.
example: 22.57
windGust:
type: number
description: The wind gust speed.
example: 43.56
windBearing:
type: integer
format: int32
description: The direction of the wind in degrees.
example: 293
cloudCover:
type: number
description: The fraction of the sky covered by clouds.
example: 0.34
uvIndex:
type: number
description: The UV index.
example: 1.9
visibility:
type: number
description: The visibility in kilometers.
example: 10
ozone:
type: number
description: The ozone concentration in Dobson units.
example: 324.42
smoke:
type: number
description: The amount of near-surface smoke in ug/m^3. Only returned when version>2.
example: 0.01
fireIndex:
type: number
description: The Fosburg fire index. Only returned when version>2.
example: 16.06
minutely:
type: object
description: A block containing minute-by-minute precipitation intensity for the next 60 minutes.
properties:
summary:
type: string
description: A summary of the minute-by-minute forecast.
example: Clear
icon:
type: string
description: An icon representing the minute-by-minute forecast.
example: clear
data:
type: array
items:
type: object
properties:
time:
type: integer
format: int32
description: The time of the data point in UNIX format.
example: 1677876000
precipIntensity:
type: number
description: The intensity of precipitation.
example: 0
precipProbability:
type: number
description: The probability of precipitation.
example: 0.4
precipIntensityError:
type: number
description: The standard deviation of the precipitation intensity.
example: 0.0299
precipType:
type: string
description: The type of precipitation occurring.
example: none
hourly:
type: object
description: A block containing hour-by-hour forecasted conditions for the next 48 hours. If `extend=hourly` is used, the hourly block gives hour-by-hour forecasted conditions for the next 168 hours.
properties:
summary:
type: string
description: A summary of the hourly forecast.
example: Clear
icon:
type: string
description: An icon representing the hourly forecast.
example: clear-night
data:
type: array
items:
type: object
properties:
time:
type: integer
format: int32
description: The time of the data point in UNIX format.
example: 1677873600
icon:
type: string
description: An icon representing the weather.
example: rain
summary:
type: string
description: A summary of the weather.
example: Rain
precipIntensity:
type: number
description: The intensity of precipitation.
example: 0.0501
precipProbability:
type: number
description: The probability of precipitation.
example: 0.55
precipIntensityError:
type: number
description: The standard deviation of the precipitation intensity.
example: 0.0294
precipAccumulation:
type: number
description: The total amount of precipitation.
example: 0.0501
precipType:
type: string
description: The type of precipitation occurring.
example: rain
temperature:
type: number
description: The air temperature.
example: 44.11
apparentTemperature:
type: number
description: The apparent temperature (feels like).
example: 35.18
dewPoint:
type: number
description: The dew point temperature.
example: 39.72
humidity:
type: number
description: The relative humidity.
example: 0.85
pressure:
type: number
description: The air pressure.
example: 978.1
windSpeed:
type: number
description: The wind speed.
example: 23.17
windGust:
type: number
description: The wind gust speed.
example: 45.1
windBearing:
type: number
format: int32
description: The direction of the wind in degrees.
example: 295
cloudCover:
type: number
description: The fraction of the sky covered by clouds.
example: 0.33
uvIndex:
type: number
description: The UV index.
example: 1.17
visibility:
type: number
description: The visibility in kilometers.
example: 10
ozone:
type: number
description: The ozone concentration in Dobson units.
example: 352.77
smoke:
type: number
description: The amount of near-surface smoke in ug/m3. Only returned when version>2.
example: 0.01
liquidAccumulation:
type: number
description: The amount of liquid precipitation expected. Only returned when version>2.
example: 0
snowAccumulation:
type: number
description: The amount of snow precipitation expected. Only returned when version>2.
example: 0
iceAccumulation:
type: number
description: The amount of ice precipitation expected. Only returned when version>2.
example: 0
nearestStormDistance:
type: number
description: The distance to the nearest storm.
example: 139.01
nearestStormBearing:
type: number
description: The direction to the nearest storm.
example: 172.87
fireIndex:
type: number
description: The Fosburg fire index. Only returned when version>2.
example: 15.03
daily:
type: object
description: A block containing day-by-day forecasted conditions for the next 7 days.
properties:
summary:
type: string
description: A summary of the daily forecast.
example: Cloudy
icon:
type: string
description: An icon representing the daily forecast.
example: cloudy
data:
type: array
items:
type: object
properties:
time:
type: integer
format: int32
description: The time of the data point in UNIX format.
example: 1677823200
icon:
type: string
description: An icon representing the weather.
example: rain
summary:
type: string
description: A summary of the weather.
example: Rain
sunriseTime:
type: integer
format: int32
description: The time of sunrise in UNIX format.
example: 1677846414
sunsetTime:
type: integer
format: int32
description: The time of sunset in UNIX format.
example: 1677887618
moonPhase:
type: number
description: The fractional lunation number for the given day.
example: 0.37
precipIntensity:
type: number
description: The intensity of precipitation.
example: 0.0097
precipIntensityMax:
type: number
description: The maximum intensity of precipitation.
example: 0.0501
precipIntensityMaxTime:
type: integer
format: int32
description: The time when the maximum precipitation intensity occurs in UNIX format.
example: 1677873600
precipProbability:
type: number
description: The probability of precipitation.
example: 0.55
precipAccumulation:
type: number
description: The total amount of precipitation.
example: 0.087
precipType:
type: string
description: The type of precipitation occurring.
example: rain
temperatureHigh:
type: number
description: The daytime high temperature.
example: 44.44
temperatureHighTime:
type: integer
format: int32
description: The time when the high temperature occurs in UNIX format.
example: 1677880800
temperatureLow:
type: number
description: The overnight low temperature.
example: 35.56
temperatureLowTime:
type: integer
format: int32
description: The time when the low temperature occurs in UNIX format.
example: 1677924000
apparentTemperatureHigh:
type: number
description: The apparent daytime high temperature (feels like).
example: 38.36
apparentTemperatureHighTime:
type: integer
format: int32
description: The time when the apparent high temperature occurs in UNIX format.
example: 1677880800
apparentTemperatureLow:
type: number
description: The apparent overnight low temperature (feels like).
example: 35.18
apparentTemperatureLowTime:
type: integer
format: int32
description: The time when the apparent low temperature occurs in UNIX format.
example: 1677920400
dewPoint:
type: number
description: The dew point temperature.
example: 39.71
humidity:
type: number
description: The relative humidity.
example: 0.862
pressure:
type: number
description: The air pressure.
example: 988.48
windSpeed:
type: number
description: The wind speed.
example: 12.87
windGust:
type: number
description: The wind gust speed.
example: 29.62
windGustTime:
type: integer
format: int32
description: The time when the maximum wind gust occurs in UNIX format.
example: 1677873600
windBearing:
type: integer
format: int32
description: The direction of the wind in degrees.
example: 304
cloudCover:
type: number
description: The fraction of the sky covered by clouds.
example: 0.49
uvIndex:
type: number
description: The max UV index during that day.
example: 1.9
uvIndexTime:
type: integer
format: int32
description: The time when the maximum UV index occurs in UNIX format.
example: 1677877200
visibility:
type: number
description: The visibility in kilometers.
example: 9.93
temperatureMin:
type: number
description: The minimum temperature.
example: 40.62
temperatureMinTime:
type: integer
format: int32
description: The time when the minimum temperature occurs in UNIX format.
example: 1677902400
temperatureMax:
type: number
description: The maximum temperature.
example: 44.44
temperatureMaxTime:
type: integer
format: int32
description: The time when the maximum temperature occurs in UNIX format.
example: 1677880800
apparentTemperatureMin:
type: number
description: The minimum apparent temperature (feels like).
example: 35.18
apparentTemperatureMinTime:
type: integer
format: int32
description: The time when the minimum apparent temperature occurs in UNIX format.
example: 1677902400
apparentTemperatureMax:
type: number
description: The maximum apparent temperature (feels like).
example: 38.36
apparentTemperatureMaxTime:
type: integer
format: int32
description: The time when the maximum apparent temperature occurs in UNIX format.
example: 1677902400
smokeMax:
type: number
description: The maximum amount of near-surface smoke in kg/m^3. Only returned when version>2.
example: 0.03
smokeMaxTime:
type: integer
format: int32
description: The time when the maximum near-surface smoke occurs in UNIX format. Only returned when version>2.
example: 1715324400
liquidAccumulation:
type: number
description: The amount of liquid precipitation expected. Only returned when version>2.
example: 0.01
snowAccumulation:
type: number
description: The amount of snow precipitation expected. Only returned when version>2.
example: 0
iceAccumulation:
type: number
description: The amount of ice precipitation expected. Only returned when version>2.
example: 0
fireIndexMax:
type: number
description: The maximum Fosburg fire index. Only returned when version>2.
example: 19.06
fireIndexMaxTime:
type: integer
format: int32
description: The time when the maximum Fosburg fire index occurs in UNIX format. Only returned when version>2.
example: 1715378400
alerts:
type: array
description: A block containing any severe weather alerts for the current location.
items:
type: object
properties:
title:
type: string
description: A brief description of the alert.
example: Flood Warning issued May 10 at 11:07AM CDT until May 17 at 5:00AM CDT by NWS Paducah KY
regions:
type: array
description: An array of strings containing all regions included in the weather alert.
items:
type: string
example: Alexander, IL
severity:
type: string
description: The severity of the weather alert.
example: Severe
time:
type: integer
format: int32
description: The time the alert was issued in UNIX format.
example: 1715357220
expires:
type: integer
format: int32
description: The time the alert expires in UNIX format.
example: 1715451300
description:
type: string
description: A detailed description of the alert.
example: "...The Flood Warning is extended for the following river in Illinois...Missouri...Kentucky... Mississippi River at Cape Girardeau, Thebes, and Hickman. .With recent heavy rainfall, waters are rising on the Mississippi River with crests in minor flood at Cape Girardeau, Thebes, and Hickman early next week. For the Mississippi River...including Cape Girardeau, Thebes, Hickman...Minor flooding is forecast. * WHAT...Minor flooding is occurring and minor flooding is forecast. * WHERE...Mississippi River at Cape Girardeau. * WHEN...Until Friday, May 17. * IMPACTS...At 36.0 feet, The flood gate on Themis Street closes. * ADDITIONAL DETAILS... - At 11:00 AM CDT Friday the stage was 34.4 feet. - Forecast...The river is expected to rise to a crest of 36.0 feet Monday morning. It will then fall below flood stage late Thursday evening. - Flood stage is 32.0 feet."
uri:
type: string
description: A HTTP(S) URL for more information about the alert.
example: https://alerts.weather.gov/search?id=urn:oid:2.49.0.1.840.0.f24c2a5f205f53c0f443861ac62244cc6aecfc9c.002.1
flags:
type: object
description: A block containing miscellaneous data for the API request.
properties:
sources:
type: array
description: The models used to generate the forecast.
items:
type: string
example: ETOPO1
sourceTimes:
type: object
description: The times in UTC when the models were last updated.
properties:
hrrr_0-18:
type: string
description: The time the HRRR model for 0-18 hours was last updated.
example: 2023-03-03 18Z
hrrr_subh:
type: string
description: The time the HRRR sub-hourly model was last updated.
example: 2023-03-03 18Z
nbm:
type: string
description: The time the NBM model was last updated.
example: 2023-03-03 18Z
nbm_fire:
type: string
description: The time the NBM fire model was last updated.
example: 2023-03-03 12Z
hrrr_18-48:
type: string
description: The time the HRRR model for 18-48 hours was last updated.
example: 2023-03-03 18Z
gfs:
type: string
description: The time the GFS model was last updated.
example: 2023-03-03 12Z
gefs:
type: string
description: The time the GEFS model was last updated.
example: 2023-03-03 12Z
nearest-station:
type: integer
format: int32
description: The distance to the nearest station (not implemented, always returns 0).
example: 0
units:
type: string
description: The units used in the forecasts.
example: us
version:
type: string
description: The version of Pirate Weather used to generate the forecast.
example: V2.0.11
sourceIDX:
type: object
description: The X, Y coordinate and the lat/long coordinate for each model used to generate the forecast. Only returned when version>2.
properties:
hrrr:
type: object
properties:
x:
type: integer
format: int32
description: The X coordinate for the HRRR model.
example: 1134
y:
type: integer
format: int32
description: The Y coordinate for the HRRR model.
example: 495
lat:
type: number
description: The latitude coordinate for the HRRR model.
example: 37.31
long:
type: number
description: The longitude coordinate for the HRRR model.
example: -89.53
nbm:
type: object
properties:
x:
type: integer
format: int32
description: The X coordinate for the NBM model.
example: 1483
y:
type: integer
format: int32
description: The Y coordinate for the NBM model.
example: 651
lat:
type: number
description: The latitude coordinate for the NBM model.
example: 37.31
long:
type: number
description: The longitude coordinate for the NBM model.
example: -89.53
gfs:
type: object
properties:
x:
type: integer
format: int32
description: The X coordinate for the GFS model.
example: 1082
y:
type: integer
format: int32
description: The Y coordinate for the GFS model.
example: 509
lat:
type: number
description: The latitude coordinate for the GFS model.
example: 37.25
long:
type: number
description: The longitude coordinate for the GFS model.
example: -89.5
etopo:
type: object
properties:
x:
type: integer
format: int32
description: The X coordinate for the ETOPO model.
example: 5429
y:
type: integer
format: int32
description: The Y coordinate for the ETOPO model.
example: 7638
lat:
type: number
description: The latitude coordinate for the ETOPO model.
example: 37.3
long:
type: number
description: The longitude coordinate for the ETOPO model.
example: -89.5166
processTime:
type: integer
format: int32
description: The time taken to process the request in milliseconds. Only returned when version>2.
example: 6970