Assignment 1
Assignment 1
ASSIGNMENT QUESTION
.
Earthquake API
.
URL: https://earthquake.usgs.gov/fdsnws/event/1/#parameter
s
.
From the link, you can find an API to display earthquakes around the
In this assignment, you are required to use JSON format and use
parameters (at least one) beside dates and location. Please think
about stories (what kind of result you would like to get from the API)
Here are two different API queries for retrieving earthquake data
using the USGS Earthquake API, along with the stories for each query:
Story 1:
URL: https://earthquake.usgs.gov/fdsnws/event/1/query
Parameters:
a) format: geojson
b) starttime: 2023-09-06
c) endtime: 2023-09-13
d) minmagnitude: 5.0
https://earthquake.usgs.gov/fdsnws/event/1/query?format=ge
ojson&starttime=2023-09-06&endtime=2023-09-
13&minmagnitude=5.0
Story 2:
URL: https://earthquake.usgs.gov/fdsnws/event/1/query
Parameters:
a) format: geojson
b) latitude: 34.0522
c) longitude: -118.2437
d) maxradius: 100
Sample API Query URL:
https://earthquake.usgs.gov/fdsnws/event/1/query?format
=geojson&latitude=34.0522&longitude=-
118.2437&maxradius=100
In these queries:
Start time and end time parameters are used to specify the time
range for the earthquake data.
Max radius in the second query defines the search radius around
the specified location.
{
"type": "FeatureCollection",
"metadata": {
"generated": 1631509707000,
"url":
"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson
&starttime=2023-09-06&endtime=2023-09-13&minmagnitude=5.0",
"title": "USGS Earthquake Hazards Program",
"status": 200,
"api": "1.12.1",
"count": 58
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 5.6,
"place": "63km S of Nishinoomote, Japan",
"time": 1631505067360,
"updated": 1631506295040,
"tz": null,
"url":
"https://earthquake.usgs.gov/earthquakes/eventpage/us7000j0ct",
"detail":
"https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000j0
ct.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 493,
"net": "us",
"code": "7000j0ct",
"ids": ",us7000j0ct,",
"sources": ",us,",
"types": ",geoserve,impact-text,nearby-cities,origin,phase-
data,scitech-link,shakemap,",
"nst": null,
"dmin": 0.452,
"rms": 0.87,
"gap": 40,
"magType": "mb",
"type": "earthquake",
"title": "M 5.6 - 63km S of Nishinoomote, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
130.7427,
29.8389,
28.78
]
},
"id": "us7000j0ct"
},
// Other earthquake features...
]
}
{
"type": "FeatureCollection",
"metadata": {
"generated": 1631382607000,
"url":
"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&latit
ude=34.0522&longitude=-118.2437&maxradius=100",
"title": "USGS Earthquake Hazards Program",
"status": 200,
"api": "1.12.1",
"count": 13
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 1.46,
"place": "1km SW of View Park-Windsor Hills, CA",
"time": 1631381914260,
"updated": 1631382130969,
"tz": null,
"url":
"https://earthquake.usgs.gov/earthquakes/eventpage/ci39914111",
"detail":
"https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ci39914111.ge
ojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 33,
"net": "ci",
"code": "39914111",
"ids": ",ci39914111,",
"sources": ",ci,",
"types": ",focal-mechanism,geoserve,nearby-cities,origin,phase-
data,scitech-link,",
"nst": 51,
"dmin": 0.08704,
"rms": 0.19,
"gap": 32,
"magType": "ml",
"type": "earthquake",
"title": "M 1.5 - 1km SW of View Park-Windsor Hills, CA"
},
"geometry": {
"type": "Point",
"coordinates": [
-118.3468333,
33.9883333,
14.53
]
},
"id": "ci39914111"
},
// Other earthquake features...
]
}