-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
770 lines (719 loc) · 24.1 KB
/
Copy pathopenapi.yaml
File metadata and controls
770 lines (719 loc) · 24.1 KB
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
openapi: 3.1.0
info:
title: ERDDAP REST API
version: "2.23"
description: |
OpenAPI specification for ERDDAP (Environmental Research Division's Data
Access Program), a scientific data server providing simple, consistent
access to gridded and tabular scientific datasets.
ERDDAP runs at many institutions worldwide. Set the server URL to the base
URL of the instance you want to access.
## Two-phase workflow for data access
1. **Discover** — search for datasets (`/search/`) or list all (`/info/index.json`).
2. **Inspect** — fetch dataset metadata (`/info/{datasetID}/index.json`) to learn
variable names, data types, units, and coordinate ranges.
3. **Download** — request data from `/tabledap/` or `/griddap/` using the
variable names and constraint ranges discovered in step 2.
## Constraint syntax (tabledap and griddap)
Constraints are appended to the query string as `&varName>=value` pairs.
| Operator | Meaning |
|----------|---------|
| `=` | equals |
| `!=` | not equals |
| `<`, `<=`, `>`, `>=` | numeric / time comparison |
| `=~` | Java regular expression match |
String values must be double-quoted: `&stationType="fixed"`.
Time values can be ISO 8601 (`2020-01-01T00:00:00Z`), seconds since
1970-01-01 (Unix epoch), or relative expressions (`now-7days`, `now-1hour`).
Spatial relative extremes are also supported: `&latitude<min(latitude)+10`.
## Response format selection
The desired format is embedded in the path (`.json`, `.csv`, `.nc`, etc.)
rather than in an `Accept` header. See the `MetadataFileType` and
`DataFileType` schemas for the full list.
contact:
name: ERDDAP Project
url: https://github.com/ERDDAP/erddap
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://coastwatch.pfeg.noaa.gov/erddap
description: NOAA CoastWatch West Coast Node (reference server)
- url: https://erddap.ioos.us/erddap
description: US IOOS ERDDAP
- url: "{baseUrl}"
description: Any ERDDAP server — replace with the instance base URL
variables:
baseUrl:
default: https://coastwatch.pfeg.noaa.gov/erddap
description: |
Base URL of any ERDDAP server, including the /erddap path segment
if present (e.g. https://example.org/erddap).
tags:
- name: Discovery
description: Search and browse available datasets.
- name: Metadata
description: Inspect variable and attribute metadata for a specific dataset.
- name: Data Access
description: Download subsets of tabular or gridded data.
- name: Files
description: Browse and download raw files associated with a dataset.
paths:
# ── Discovery ──────────────────────────────────────────────────────────────
/search/index.{fileType}:
get:
summary: Full-text search across all datasets
operationId: searchDatasets
tags: [Discovery]
description: |
Google-like search of dataset metadata. Words are matched separately
(AND logic). Phrase search: `"wind speed"`. Exclude a word: `-salinity`.
Case-insensitive; partial words are matched.
parameters:
- $ref: "#/components/parameters/metadataFileType"
- name: searchFor
in: query
required: true
schema:
type: string
example: "sea surface temperature"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/itemsPerPage"
responses:
"200":
description: Matching datasets.
content:
application/json:
schema:
$ref: "#/components/schemas/DatasetList"
text/csv:
schema:
type: string
/search/advanced.{fileType}:
get:
summary: Advanced search with metadata and spatial/temporal filters
operationId: searchDatasetsAdvanced
tags: [Discovery]
description: |
Filter datasets by protocol, CDM data type, institution, IOOS category,
CF standard name, variable name, bounding box, and time range.
All filter parameters default to `(ANY)` (no filter applied).
parameters:
- $ref: "#/components/parameters/metadataFileType"
- name: searchFor
in: query
description: Free-text search terms (same syntax as simple search).
schema:
type: string
- name: protocol
in: query
schema:
type: string
enum: ["(ANY)", tabledap, griddap, wms, wcs]
default: "(ANY)"
- name: cdm_data_type
in: query
description: CF Discrete Sampling Geometry type.
schema:
type: string
enum:
- "(ANY)"
- Grid
- TimeSeries
- TimeSeriesProfile
- Trajectory
- TrajectoryProfile
- Point
- Profile
- Other
default: "(ANY)"
- name: institution
in: query
schema:
type: string
default: "(ANY)"
- name: ioos_category
in: query
description: IOOS data category (e.g. Temperature, Salinity, Currents).
schema:
type: string
default: "(ANY)"
- name: keywords
in: query
schema:
type: string
default: "(ANY)"
- name: long_name
in: query
schema:
type: string
default: "(ANY)"
- name: standard_name
in: query
description: CF standard name (e.g. sea_surface_temperature).
schema:
type: string
default: "(ANY)"
- name: variableName
in: query
description: Variable short name as it appears in the dataset.
schema:
type: string
default: "(ANY)"
- name: minLon
in: query
description: Western boundary (decimal degrees, -180 to 180).
schema:
type: number
minimum: -180
maximum: 180
- name: maxLon
in: query
description: Eastern boundary (decimal degrees, -180 to 180).
schema:
type: number
minimum: -180
maximum: 180
- name: minLat
in: query
description: Southern boundary (decimal degrees, -90 to 90).
schema:
type: number
minimum: -90
maximum: 90
- name: maxLat
in: query
description: Northern boundary (decimal degrees, -90 to 90).
schema:
type: number
minimum: -90
maximum: 90
- name: minTime
in: query
description: Earliest time (ISO 8601 or seconds since 1970-01-01T00:00:00Z).
schema:
type: string
example: "2020-01-01T00:00:00Z"
- name: maxTime
in: query
description: Latest time (ISO 8601 or seconds since 1970-01-01T00:00:00Z).
schema:
type: string
example: "2020-12-31T23:59:59Z"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/itemsPerPage"
responses:
"200":
description: Matching datasets.
content:
application/json:
schema:
$ref: "#/components/schemas/DatasetList"
text/csv:
schema:
type: string
/info/index.{fileType}:
get:
summary: List all datasets available on this server
operationId: listAllDatasets
tags: [Discovery]
description: Returns every dataset the server exposes, with title, institution, and access URLs.
parameters:
- $ref: "#/components/parameters/metadataFileType"
- $ref: "#/components/parameters/itemsPerPage"
responses:
"200":
description: All datasets on this ERDDAP server.
content:
application/json:
schema:
$ref: "#/components/schemas/DatasetList"
text/csv:
schema:
type: string
/categorize/{attribute}/index.{fileType}:
get:
summary: List all distinct values for a metadata attribute
operationId: listAttributeValues
tags: [Discovery]
description: Returns every distinct value that appears for the given attribute across all datasets on this server.
parameters:
- $ref: "#/components/parameters/categorizeAttribute"
- $ref: "#/components/parameters/metadataFileType"
responses:
"200":
description: All distinct values for the attribute across this server's datasets.
/categorize/{attribute}/{value}/index.{fileType}:
get:
summary: List datasets that match a specific metadata attribute value
operationId: listDatasetsByAttribute
tags: [Discovery]
description: Filters the full dataset list to those whose metadata contains the specified attribute value (case-insensitive).
parameters:
- $ref: "#/components/parameters/categorizeAttribute"
- name: value
in: path
required: true
description: The attribute value to filter by (case-insensitive).
schema:
type: string
example: temperature
- $ref: "#/components/parameters/metadataFileType"
responses:
"200":
description: Datasets whose metadata matches the given attribute value.
content:
application/json:
schema:
$ref: "#/components/schemas/DatasetList"
text/csv:
schema:
type: string
# ── Metadata ───────────────────────────────────────────────────────────────
/info/{datasetID}/index.{fileType}:
get:
summary: Get variable and attribute metadata for a dataset
operationId: getDatasetInfo
tags: [Metadata]
description: |
Returns a table describing every variable and global attribute in the
dataset. Each row is one of:
| Row Type | Variable Name | Attribute Name | Data Type | Value |
|-----------|--------------|----------------|-----------|-------|
| attribute | NC_GLOBAL | title | String | ... |
| variable | time | | double | |
| attribute | time | units | String | seconds since 1970-01-01T00:00:00Z |
Use this response to discover variable names, units, `standard_name`,
and the actual coordinate ranges (`actual_range` attributes) before
constructing a data request.
parameters:
- name: datasetID
in: path
required: true
description: Unique dataset identifier (visible in search results as the `ID` column).
schema:
type: string
example: erdMBsstd1day
- $ref: "#/components/parameters/metadataFileType"
responses:
"200":
description: Dataset metadata table.
content:
application/json:
schema:
$ref: "#/components/schemas/DatasetInfo"
text/csv:
schema:
type: string
"404":
description: Dataset not found on this server.
# ── Data Access ────────────────────────────────────────────────────────────
/tabledap/{datasetID}.{fileType}:
get:
summary: Download a subset of a tabular dataset
operationId: getTabledapData
tags: [Data Access]
description: |
Retrieves in-situ, station, trajectory, or profile data (CDM types
other than Grid).
**Query string structure:** `?variables&constraints`
- `variables` — comma-separated variable names; omit for all variables.
- `constraints` — `&varName>=value` pairs appended after the variable list.
**Special result modifiers (append to query):**
- `&distinct()` — return only unique rows.
- `&orderBy("var1,var2")` — sort results.
- `&orderByMax("var1")` — keep only the row with the max value per group.
- `&units("UDUNITS")` — convert units.
Always call `/info/{datasetID}/index.json` first to discover valid
variable names and coordinate ranges.
parameters:
- name: datasetID
in: path
required: true
schema:
type: string
example: cwwcNDBCMet
- name: fileType
in: path
required: true
schema:
$ref: "#/components/schemas/DataFileType"
- name: variables
in: query
description: |
Comma-separated variable names to include in the response.
Omit to return all variables.
schema:
type: string
example: "time,latitude,longitude,wtmp"
- name: time>=
in: query
description: Lower time bound (ISO 8601 or `now-Nunit` expression).
schema:
type: string
example: "2020-01-01T00:00:00Z"
- name: time<=
in: query
description: Upper time bound.
schema:
type: string
- name: latitude>=
in: query
schema:
type: number
- name: latitude<=
in: query
schema:
type: number
- name: longitude>=
in: query
schema:
type: number
- name: longitude<=
in: query
schema:
type: number
responses:
"200":
description: Tabular data subset in the requested format.
content:
text/csv:
schema:
type: string
application/json:
schema:
$ref: "#/components/schemas/TabledapJsonResponse"
application/x-netcdf:
schema:
type: string
format: binary
"400":
description: |
Bad request. Common causes: unknown variable name, constraint value
out of range, malformed constraint syntax.
"404":
description: Dataset not found.
/griddap/{datasetID}.{fileType}:
get:
summary: Download a subset of a gridded dataset
operationId: getGriddapData
tags: [Data Access]
description: |
Retrieves satellite, model, or reanalysis data (CDM Grid type).
**Query string structure:**
`?var1[(d1_start):(d1_stop)][(d2_start):(d2_stop)],...`
Dimension subscripts use parentheses for value-based indexing:
`?sst[(2020-01-01T12:00:00Z)][(0.0)][(20.0):(50.0)][(-80.0):(-60.0)]`
Stride syntax: `[(start):(stride):(stop)]`
Select all values in a dimension: `[]`
Dimensions are always in the order shown by `/info/{datasetID}/index.json`
(typically time, altitude/depth, latitude, longitude for 4-D datasets).
Always call `/info/{datasetID}/index.json` first to discover dimension
names, their order, and valid ranges.
parameters:
- name: datasetID
in: path
required: true
schema:
type: string
example: erdMBsstd1day
- name: fileType
in: path
required: true
schema:
$ref: "#/components/schemas/DataFileType"
responses:
"200":
description: Gridded data subset in the requested format.
content:
application/x-netcdf:
schema:
type: string
format: binary
text/csv:
schema:
type: string
application/json:
schema:
type: object
"400":
description: Bad request — unknown variable or out-of-range dimension subscript.
"404":
description: Dataset not found.
# ── Files ──────────────────────────────────────────────────────────────────
/files/{datasetID}:
get:
summary: Browse raw files for a dataset
operationId: listDatasetFiles
tags: [Files]
description: |
Returns an HTML directory listing of the raw source files for datasets
that expose a file system. Individual files can be downloaded by
appending the filename to this URL.
parameters:
- name: datasetID
in: path
required: true
schema:
type: string
responses:
"200":
description: HTML directory listing.
content:
text/html:
schema:
type: string
# ── Reusable components ────────────────────────────────────────────────────
components:
parameters:
metadataFileType:
name: fileType
in: path
required: true
schema:
$ref: "#/components/schemas/MetadataFileType"
categorizeAttribute:
name: attribute
in: path
required: true
description: Metadata attribute to categorize by.
schema:
type: string
enum:
- cdm_data_type
- institution
- ioos_category
- keywords
- keywords_vocabulary
- long_name
- standard_name
- variableName
page:
name: page
in: query
description: Page number (1-based).
schema:
type: integer
minimum: 1
default: 1
itemsPerPage:
name: itemsPerPage
in: query
description: Maximum number of results to return.
schema:
type: integer
minimum: 1
default: 1000000
schemas:
MetadataFileType:
type: string
description: Response format for discovery and metadata endpoints.
enum:
- html
- csv
- csvp
- csv0
- json
- jsonlCSV1
- jsonlCSV
- jsonlKVP
- tsv
- tsvp
- tsv0
- xhtml
DataFileType:
type: string
description: Response format for tabledap and griddap data requests.
enum:
- csv
- csvp
- csv0
- json
- jsonlCSV1
- jsonlCSV
- jsonlKVP
- tsv
- tsvp
- tsv0
- nc
- ncHeader
- ncCF
- ncCFHeader
- ncCFMA
- ncCFMAHeader
- nccsv
- nccsvMetadata
- ncoJson
- mat
- asc
- das
- dds
- dods
- esriCsv
- fgdc
- geoJson
- iso19115
- itx
- kml
- odvTxt
- smallPdf
- pdf
- largePdf
- smallPng
- png
- largePng
- transparentPng
- wav
- xhtml
- html
- dataTable
- subset
- graph
DatasetList:
type: object
description: |
ERDDAP wraps all JSON responses in a `table` envelope with parallel
`columnNames`, `columnTypes`, and `rows` arrays.
properties:
table:
type: object
required: [columnNames, columnTypes, rows]
properties:
columnNames:
type: array
items:
type: string
example:
- griddap
- Subset
- tabledap
- Make A Graph
- wms
- files
- Accessible
- Title
- Summary
- FGDC
- ISO 19115
- Info
- Background Info
- RSS
- Email
- Institution
- ID
columnTypes:
type: array
items:
type: string
example:
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
- String
rows:
type: array
description: One array per dataset; values correspond to columnNames.
items:
type: array
items: {}
DatasetInfo:
type: object
description: |
Variable and attribute metadata for a single dataset, returned as an
ERDDAP table with five columns.
properties:
table:
type: object
required: [columnNames, columnTypes, rows]
properties:
columnNames:
type: array
items:
type: string
example:
- Row Type
- Variable Name
- Attribute Name
- Data Type
- Value
columnTypes:
type: array
items:
type: string
example:
- String
- String
- String
- String
- String
rows:
type: array
description: |
Row types:
- `attribute` + `NC_GLOBAL` — dataset-level (global) attribute.
- `variable` — declares a variable (Attribute Name and Value are empty).
- `attribute` + variable name — attribute of that variable.
items:
type: array
minItems: 5
maxItems: 5
items: {}
prefixItems:
- description: "Row Type: 'attribute' or 'variable'"
type: string
- description: "Variable Name or 'NC_GLOBAL'"
type: string
- description: "Attribute Name (empty for variable rows)"
type: string
- description: "Data Type (String, double, float, int, …)"
type: string
- description: "Value"
type: string
example:
- [attribute, NC_GLOBAL, title, String, "NDBC Standard Meteorological Buoy Data"]
- [attribute, NC_GLOBAL, institution, String, "NOAA NDBC"]
- [variable, time, "", double, ""]
- [attribute, time, units, String, "seconds since 1970-01-01T00:00:00Z"]
- [attribute, time, actual_range, double, "1.0E9, 1.7E9"]
- [variable, wtmp, "", float, ""]
- [attribute, wtmp, long_name, String, "SST"]
- [attribute, wtmp, units, String, "degree_C"]
TabledapJsonResponse:
type: object
description: JSON response from a tabledap data request (same envelope as DatasetList).
properties:
table:
type: object
required: [columnNames, columnTypes, columnUnits, rows]
properties:
columnNames:
type: array
items:
type: string
columnTypes:
type: array
items:
type: string
columnUnits:
type: array
items:
type: string
nullable: true
rows:
type: array
items:
type: array
items: {}