NetBurner 3.5.0
PDF Version
 
JSON Lexer

Using the JSON Lexer Interface

Note
This application note applies to NNDK tools version 3.3.9 and later. The many additional features added will not build in earlier tools versions.

The Json Lexer interface is in json_lexer.h. The two object types that are of interest are:

  1. ParsedJsonDataSet: represents a complete JSON object parsed and stored internally.
  2. JsonRef: represents a positional reference of location inside a ParsedJsonDataSet. It can be used as a pointer to a variable or sub object inside a ParsedJsonDataSet object to make decoding the hierarchy much simpler and easier to understand. A JsonRef is not limited to just pointing at internal objects; it can point to any JSON parsed token/type.

The ParsedJsonDataSet has two decoding interfaces. The previous interface prior to 3.3.9 should be considered deprecated. If you have used this class in the past this code will still work, but we have added a new much clearer easier to understand interface based on the JsonRef object and the associated overloaded operators. This interface should be used for all decoding going forward.

Before we can practice decoding JSON, we need to get the JSON content into a ParsedJsonDataSet object. There are multiple methods to accomplish this:

  1. Load from a text blob as demonstrated in the example: \nburn\examples\JsonLexer\ParseTest. Calling the function ParsedJsonDataSet pjd((const char *)jdata, jlen, true); will construct an object from plain text.
  2. Load from an external web page as demonstrated in the examples:
  • \nburn\examples\JSON\GetJsonFromServer
  • \nburn\examples\JSON\PostAndGetJsonExternalServer
  • \nburn\examples\WebClient\EarthQuake
  1. Load from some type of external interface, web socket, serial port, etc.
  • ParsedJsonDataSet pjds; // declare the object
  • pjds.ReadFrom(int fd); // read the content from a file descriptor

Once you have a complete ParsedJsonDataSet, you can operate on it and decode the JSON content.

For example, we have a simple JSON structure:

{ “Anumber”: 1234,
“AString”:“ImaString”,
“AnObject”:{“Item1”:1,
“Item2”:”TheItem2”
},
“AnArray” : [1,2,3,4]
}

Using one of the three methods listed above will convert the JSON content into a ParsedJsonDataSet object named pjds. Internally, the ParsedJsonDataSet toekenizes the JSON it is loaded with and stores the results in minimized form in NetBurner poolBuffers. None of these internals really matter to the user.

To extract values from the parsed data set:

int i = pjds(“ANumber”); // Read an integer
// Strings can be accessed as a NBString object or const char *.
// The const char * is only valid until the dataset is destroyed or cleaned up.
NBString s = pjds(“AString”);
const char * pStr = pjs(“AString”);
// JsonRef can be used as a pointer to reference interior variables and objects
// in the data set and access them in the same manor.
JsonRef jr = pjds(“AnObject”);
int i1 = jr(“Item1”);
NBString s2 = jr(“Item2”);
// Arrays can be indexed using the array operator
for(int i = 0; I < 4; i++)
printf(“Item[%d] = %d\n”, i, pjds(“AnArray”)[i]);
Represents a positional reference (pointer) of a location inside a ParsedJsonDataSet object
Definition json_lexer.h:112
Lightweight alternative to C++ CString class.
Definition nbstring.h:118

In general, you can use (“name”) to find an element and [i] to index in an array. You can then assign the result to the desired object or variable.

ParsedJsonDataSet types:

operator bool () const {return PermissiveCurrentBool(); };
operator float () const {return (float)CurrentNumber(); };
operator double () const {return CurrentNumber(); };
operator uint8_t() const {return (uint8_t)CurrentNumber(); };
operator int() const {return (int)CurrentNumber(); };
operator uint16_t() const {return (uint16_t)CurrentNumber(); };
operator uint32_t() const {return (uint32_t)CurrentNumber(); };
operator int8_t() const {return (int8_t)CurrentNumber(); };
operator int16_t() const {return (int16_t)CurrentNumber(); };
operator int32_t() const {return (uint32_t)CurrentNumber(); };
operator time_t() const {return (time_t)CurrentNumber(); };
operator const char *() const {return CurrentString(); };
operator NBString() const {return (NBString)CurrentString(); };

There are corresponding check functions as well in the form of: bool IsValid(); to determine if the dereferenced ParsedJsonDataSet element or JsonRef point to something valid.

Continuing from the example above:

pjds(“AnArray”)[3].IsValid(); // returns true, a valid decode
pjs(“AnArray”)[4].IsValid(); // returns false as there are only array elements 0 - 3

Additonal Check Functions:

IsNumber()
IsObject()
IsString()
IsBool()
IsNull()
IsArray()

These functions are demonstrated very well in: \nburn\examples\JsonLexer\ParseTest. The example \nburn\examples\webclient\Earthquake uses these functions to extract various fields from inside a very large complicated JSON blob and is an interesting example to see the simplification these methods provide.

Earthquake Example

Note
If you wish to use any of this code, do not copy from this document. Get the latest code from the example source: \nburn\examples\webclient\Earthquake

Source Code

/*NB_REVISION*/
/*NB_COPYRIGHT*/
#include <init.h>
#include <stdio.h>
#include <ctype.h>
#include <buffers.h>
#include <json_lexer.h>
#include <nbtime.h> // Include for NTP functions
const char *url = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.geojson";
const char *AppName = "EarthQuake";
void UserMain(void *pd)
{
init(); // Initialize network stack
// Enable system diagnostics. Probably should remove for production code.
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait for DHCP address
iprintf("Application started\n");
bool bTimeSet = SetTimeNTPFromPool();
if(bTimeSet)
{
printf("Time Set\r\n");
}
ParsedJsonDataSet JsonResult;
bool result = DoGet(url, JsonResult);
if (result)
{
// JsonResult.PrintObject(true);
int32_t nQuakes = JsonResult("metadata")("count");
printf("In the last Day we have had %ld Earthquakes > 4.5\r\n", nQuakes);
for (int i = 0; i < nQuakes; i++)
{ // A JsonRef is a pointer into a ParsedJsonDataSet object varible or object to simplify access.
// The following code creates a pointer into the event array to capture the properties object.
JsonRef OneQuakeProperties = JsonResult("features")[i]("properties");
if (OneQuakeProperties.Valid())
{
double magnitude = OneQuakeProperties("mag");
NBString place_name = OneQuakeProperties("place");
printf("Magnitude :%2.1f at %s", magnitude, place_name.c_str());
if (bTimeSet)
{
time_t when = OneQuakeProperties("time");
when /= 1000;
time_t now = time(NULL);
time_t delta = (now - when);
int sec = delta % 60;
int mins = (delta / 60) % 60;
int hour = (delta / 3600);
printf(" %02d:%02d:%02d ago", hour, mins, sec);
}
printf("\r\n");
} //Array object look up is valid
else
{
printf("Parse error failed to find array element %d\r\n", i);
}
} // for
} // valid result
else
{
iprintf("Failed to contact server\r\n");
}
while (1)
{
}
}
NetBurner Buffers API.
bool Valid() const
Check if the current JsonRef is a valid JSON position.
Definition json_lexer.h:397
const char * c_str() const
Method to pass a NBString as a constant char *.
A class to create, read, and modify a JSON object.
Definition json_lexer.h:530
#define TICKS_PER_SECOND
System clock ticks per second.
Definition nbrtos/include/constants.h:41
void OSTimeDly(uint32_t to_count)
Delay the task until the specified value of the system timer ticks. The number of system ticks per se...
Definition nbrtos.h:1732
bool DoGet(ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
void init()
System initialization. Ideally called at the beginning of all applications, since the easiest Recover...
void EnableSystemDiagnostics()
Turn on the diagnostic reports from the config page.
bool WaitForActiveNetwork(uint32_t ticks_to_wait=120 *TICKS_PER_SECOND, int interface=-1)
Wait for an active network connection on at least one interface.
JSON HTTP functions.
NetBurner System Initialization Header File.
NetBurner JSON Lexer. See the JSON Lexer page for complete documentation.
NetBurner Time Header File.

Earthquake Summary Serial Output

This is the summary output from the example:

In the last Day we have had 17 Earthquakes > 4.5 Magnitude :4.5 at Fiji region 01:44:12 ago Magnitude :4.6 at 128 km W of San Juan, Peru 10:06:35 ago Magnitude :4.5 at 7 km NW of Papayal, Peru 10:32:50 ago Magnitude :4.9 at 56 km SSE of Sand Point, Alaska 10:47:22 ago Magnitude :4.9 at 22 km SSE of Padong, Philippines 11:05:28 ago Magnitude :5.1 at 70 km WNW of San Antonio de los Cobres, Argentina 12:25:58 ago Magnitude :5.3 at 116 km SSE of Kushiro, Japan 13:12:09 ago Magnitude :4.6 at 112 km SSE of Kushiro, Japan 13:13:00 ago Magnitude :4.8 at 129 km WNW of Pangai, Tonga 13:49:43 ago Magnitude :4.9 at 256 km ESE of Ust’-Kamchatsk Staryy, Russia 20:15:25 ago Magnitude :4.6 at 120 km NNE of Tobelo, Indonesia 20:23:53 ago Magnitude :4.9 at 57 km ESE of Koseda, Japan 21:28:56 ago Magnitude :4.8 at 24 km NE of La Paz, Philippines 22:38:44 ago Magnitude :4.5 at northern Qinghai, China 23:10:02 ago Magnitude :4.6 at 8 km S of Padong, Philippines 23:13:24 ago Magnitude :4.5 at Fiji region 23:19:04 ago Magnitude :5.1 at 108 km SSE of Hihifo, Tonga 23:39:10 ago

JSON Data Parsed From Web Site

The raw JSON content is shown below. This is a good example of how a very complex JSON blob can be easily parsed with the ParsedJsonDataSet object. To view this data when running the example, uncomment the line: // JsonResult.PrintObject(true); in the source code.

{
"type": "FeatureCollection",
"metadata": {
"generated": 1666815488000,
"url": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.geojson",
"title": "USGS Magnitude 4.5+ Earthquakes, Past Day",
"status": 200,
"api": "1.10.3",
"count": 17
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "Fiji region",
"time": 1666809240464,
"updated": 1666814388040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikie",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikie.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikie",
"ids": ",us7000ikie,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 60,
"dmin": 3.053,
"rms": 1,
"gap": 74,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - Fiji region"
},
"geometry": {
"type": "Point",
"coordinates": [
-178.3577,
-20.3848,
551.981
]
},
"id": "us7000ikie"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "128 km W of San Juan, Peru",
"time": 1666779097415,
"updated": 1666779906040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikgd",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikgd.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikgd",
"ids": ",us7000ikgd,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 36,
"dmin": 3.395,
"rms": 0.54,
"gap": 174,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 128 km W of San Juan, Peru"
},
"geometry": {
"type": "Point",
"coordinates": [
-76.3603,
-15.3705,
10
]
},
"id": "us7000ikgd"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "7 km NW of Papayal, Peru",
"time": 1666777522132,
"updated": 1666779183255,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikg9",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikg9.geojson",
"felt": 1,
"cdi": 2.7,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikg9",
"ids": ",us7000ikg9,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 33,
"dmin": 0.862,
"rms": 0.85,
"gap": 165,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - 7 km NW of Papayal, Peru"
},
"geometry": {
"type": "Point",
"coordinates": [
-80.7874,
-4.027,
44.425
]
},
"id": "us7000ikg9"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "56 km SSE of Sand Point, Alaska",
"time": 1666776650887,
"updated": 1666803216746,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikg1",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikg1.geojson",
"felt": 2,
"cdi": 3.6,
"mmi": 3.716,
"alert": null,
"status": "reviewed",
"tsunami": 1,
"sig": 370,
"net": "us",
"code": "7000ikg1",
"ids": ",us7000ikg1,at00rkct3e,ak022dqn87rq,",
"sources": ",us,at,ak,",
"types": ",dyfi,impact-link,moment-tensor,origin,phase-data,shakemap,",
"nst": 232,
"dmin": 0.369,
"rms": 0.6,
"gap": 127,
"magType": "mww",
"type": "earthquake",
"title": "M 4.9 - 56 km SSE of Sand Point, Alaska"
},
"geometry": {
"type": "Point",
"coordinates": [
-160.2254,
54.8564,
41.855
]
},
"id": "us7000ikg1"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "22 km SSE of Padong, Philippines",
"time": 1666775564622,
"updated": 1666776869040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfz",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfz.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikfz",
"ids": ",us7000ikfz,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 73,
"dmin": 4.915,
"rms": 0.54,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 22 km SSE of Padong, Philippines"
},
"geometry": {
"type": "Point",
"coordinates": [
120.8605,
17.8819,
36.251
]
},
"id": "us7000ikfz"
},
{
"type": "Feature",
"properties": {
"mag": 5.1,
"place": "70 km WNW of San Antonio de los Cobres, Argentina",
"time": 1666770734080,
"updated": 1666775309650,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfn",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfn.geojson",
"felt": 1,
"cdi": 2.7,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 400,
"net": "us",
"code": "7000ikfn",
"ids": ",us7000ikfn,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 55,
"dmin": 1.573,
"rms": 1,
"gap": 40,
"magType": "mww",
"type": "earthquake",
"title": "M 5.1 - 70 km WNW of San Antonio de los Cobres, Argentina"
},
"geometry": {
"type": "Point",
"coordinates": [
-66.9953,
-24.0942,
185.017
]
},
"id": "us7000ikfn"
},
{
"type": "Feature",
"properties": {
"mag": 5.3,
"place": "116 km SSE of Kushiro, Japan",
"time": 1666767963104,
"updated": 1666790561040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfi",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfi.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 432,
"net": "us",
"code": "7000ikfi",
"ids": ",us7000ikfi,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 90,
"dmin": 1.178,
"rms": 1.04,
"gap": 99,
"magType": "mww",
"type": "earthquake",
"title": "M 5.3 - 116 km SSE of Kushiro, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
144.7352,
41.9619,
35.062
]
},
"id": "us7000ikfi"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "112 km SSE of Kushiro, Japan",
"time": 1666767912312,
"updated": 1666769828040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfl",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfl.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikfl",
"ids": ",us7000ikfl,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 27,
"dmin": 1.163,
"rms": 0.38,
"gap": 176,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 112 km SSE of Kushiro, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
144.7166,
41.9912,
37.754
]
},
"id": "us7000ikfl"
},
{
"type": "Feature",
"properties": {
"mag": 4.8,
"place": "129 km WNW of Pangai, Tonga",
"time": 1666765709390,
"updated": 1666767075040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikff",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikff.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 354,
"net": "us",
"code": "7000ikff",
"ids": ",us7000ikff,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 32,
"dmin": 1.175,
"rms": 1.12,
"gap": 64,
"magType": "mb",
"type": "earthquake",
"title": "M 4.8 - 129 km WNW of Pangai, Tonga"
},
"geometry": {
"type": "Point",
"coordinates": [
-175.5083,
-19.3888,
235.932
]
},
"id": "us7000ikff"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "256 km ESE of Ust’-Kamchatsk Staryy, Russia",
"time": 1666742567939,
"updated": 1666743756040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikdk",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikdk.geojson",
"felt": null,
"cdi": null,
"mmi": 3.339,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikdk",
"ids": ",us7000ikdk,ak022dqhpbfw,",
"sources": ",us,ak,",
"types": ",origin,phase-data,shakemap,",
"nst": 69,
"dmin": 5.174,
"rms": 0.38,
"gap": 83,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 256 km ESE of Ust’-Kamchatsk Staryy, Russia"
},
"geometry": {
"type": "Point",
"coordinates": [
166.3788,
55.5213,
10
]
},
"id": "us7000ikdk"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "120 km NNE of Tobelo, Indonesia",
"time": 1666742059732,
"updated": 1666743214040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikde",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikde.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikde",
"ids": ",us7000ikde,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 37,
"dmin": 2.209,
"rms": 0.9,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 120 km NNE of Tobelo, Indonesia"
},
"geometry": {
"type": "Point",
"coordinates": [
128.3655,
2.756,
212.676
]
},
"id": "us7000ikde"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "57 km ESE of Koseda, Japan",
"time": 1666738156180,
"updated": 1666741703040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikcv",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikcv.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikcv",
"ids": ",us7000ikcv,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 65,
"dmin": 1.465,
"rms": 0.66,
"gap": 122,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 57 km ESE of Koseda, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
131.2036,
30.1903,
32.26
]
},
"id": "us7000ikcv"
},
{
"type": "Feature",
"properties": {
"mag": 4.8,
"place": "24 km NE of La Paz, Philippines",
"time": 1666733968988,
"updated": 1666735447870,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikch",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikch.geojson",
"felt": 1,
"cdi": 3.8,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 355,
"net": "us",
"code": "7000ikch",
"ids": ",us7000ikch,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 73,
"dmin": 4.996,
"rms": 0.56,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.8 - 24 km NE of La Paz, Philippines"
},
"geometry": {
"type": "Point",
"coordinates": [
120.8722,
17.8003,
35.567
]
},
"id": "us7000ikch"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "northern Qinghai, China",
"time": 1666732090914,
"updated": 1666733158040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc3",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc3.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikc3",
"ids": ",us7000ikc3,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 61,
"dmin": 10.77,
"rms": 0.67,
"gap": 64,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - northern Qinghai, China"
},
"geometry": {
"type": "Point",
"coordinates": [
92.2784,
37.7294,
10
]
},
"id": "us7000ikc3"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "8 km S of Padong, Philippines",
"time": 1666731888656,
"updated": 1666735766443,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc6",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc6.geojson",
"felt": 0,
"cdi": 1,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikc6",
"ids": ",us7000ikc6,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 54,
"dmin": 4.828,
"rms": 0.78,
"gap": 127,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 8 km S of Padong, Philippines"
},
"geometry": {
"type": "Point",
"coordinates": [
120.7462,
17.975,
48.754
]
},
"id": "us7000ikc6"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "Fiji region",
"time": 1666731548904,
"updated": 1666734071040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc1",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc1.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikc1",
"ids": ",us7000ikc1,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 26,
"dmin": 3.012,
"rms": 0.4,
"gap": 124,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - Fiji region"
},
"geometry": {
"type": "Point",
"coordinates": [
-178.3447,
-20.5028,
590.211
]
},
"id": "us7000ikc1"
},
{
"type": "Feature",
"properties": {
"mag": 5.1,
"place": "108 km SSE of Hihifo, Tonga",
"time": 1666730342483,
"updated": 1666733344040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc5",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc5.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 400,
"net": "us",
"code": "7000ikc5",
"ids": ",us7000ikc5,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 52,
"dmin": 1.882,
"rms": 1.07,
"gap": 69,
"magType": "mb",
"type": "earthquake",
"title": "M 5.1 - 108 km SSE of Hihifo, Tonga"
},
"geometry": {
"type": "Point",
"coordinates": [
-173.386,
-16.8501,
19.916
]
},
"id": "us7000ikc5"
}
],
"bbox": [
-178.3577,
-24.0942,
10,
166.3788,
55.5213,
590.211
]
}