Loading a Dataset Card
We assume that you have already obtained your Dateno API key. Let’s now load a dataset card using the Dateno REST API. Before writing any code, we will use a popular API testing tool.
Exercise Plan
Follow these steps to complete the process:
- Choosing a dataset for this exercise
- Retrieving the dataset identifier
- Configuring a request in the API testing tool
- Sending the request and reviewing the response
Choosing a Dataset for This Exercise
Any dataset will work for this simple exercise. However, it’s best to choose one that contains at least one data file to make the response more informative.
TIP
Use the Format facet to exclude datasets without data files. Select the CSV format to choose datasets that provide tabular data.
Retrieving the Dataset Identifier
To load a dataset card, you need its unique identifier. Follow these steps to find it:
- Open the dataset card for the dataset you want to use.
- Locate the ID field in the dataset card.
- Copy the unique dataset identifier.
Configuring a Request in a Testing Tool
Now, set up a GET HTTP request in your API testing tool. The request must include:
- The endpoint URL
- The dataset ID (as part of the path)
- Your API key (as a query parameter named
apikey
)
Here’s a sample request:
https://api.dateno.io/search/0.1/entry/92ecad2c7fe1931cc13c29f28840f92269ae6d435e154a45a4e14734bef14d14?apikey=AbCdEfGhIjKlMnOpQrStUvWxYz123456
ATTENTION
Make sure you are using your valid Dateno API key.
Sending the Request and Reviewing the Response
Send the configured request and wait for the Dateno server to respond.
Below is an example of a successful JSON response. You can download data files associated with the dataset now.
{
"_index": "dateno",
"_id": "92ecad2c7fe1931cc13c29f28840f922...",
"_version": 1,
"_seq_no": 1246038,
"_primary_term": 2,
"found": true,
"_source": {
"resources": [
{
"name": "ArcGIS GeoService",
"format": null,
"mimetype": "application/json",
"d_ext": ".json",
"d_mime": "application/json",
"url": "https://services2..."
},
{
"name": "CSV",
"format": null,
"mimetype": "text/csv",
"d_ext": ".csv",
"d_mime": "text/csv",
"url": "https://rigis-edc.."
}
],
"int_id": "https://www.arcgis...",
"source": {
"schema": "dcatus11",
"uid": "cdi00003935",
"owner_name": "Environmental Data Center",
"software": {
"name": "ArcGIS Hub",
"id": "arcgishub"
},
"catalog_type": "Geoportal",
"name": "RIGIS",
"macroregions": [
{
"name": "Northern America",
"id": "021"
}
],
"langs": [
{
"name": "English",
"id": "EN"
}
],
"countries": [
{
"name": "United States",
"id": "US"
}
],
"subregions": [],
"owner_type": "Unknown",
"url": "https://rigis-edc.opendata.arcgis.com/"
},
"id": "92ecad2c7fe1931cc13c29f2884...",
"scores": {
"feature_score": 98
},
"dataset": {
"topics_original": [
"geospatial"
],
"geotopics": [],
"formats": [
".json",
".zip",
".csv",
".geojson",
".kml"
],
"topics": [
"Regions and cities"
],
"date_created": "2017-06-28T17:26:38.000Z",
"short_text": "The Urban Services Boundary...",
"num_resources": 8,
"description": "<p>The Urban Services Boundary was...</p>",
"title": "Urban Services Boundary",
"date_changed": "2021-05-28T12:39:33.520Z",
"url": "https://rigis-edc...",
"datatypes": [
"other",
"data",
"archives",
"geodata"
],
"has_archive": false,
"tags": [
"PLAN",
"RIGIS",
"Rhode Island",
"GNIS",
"land use",
"future state land use",
"planning",
"growth management",
"infrastructure"
],
"responsible": [
{
"role": "Publisher",
"title": "Rhode Island Division of Planning"
}
],
"id": "https://www.arcgis.com..."
}
}
}