API quick start¶
Order and download historical base-station data in six steps with the API. If you would rather use a browser, see the PPK portal. The same calls work from any language or tool; see the API reference for every field. For the big picture, see How it works.
Before you start
- A PPK account (username and password). See How to obtain an account.
- Pick the tab for your shell. Bash needs
curlandjq(jqpicks a value out of the JSON reply). PowerShell needs nothing extra. CMD usescurl.exe, which is built into Windows 10 and later.
Step 1: Get a token¶
Sign in to get a token. You send it with every later request, and it stays valid for seven days.
Step 2: Find a station¶
Ask for the stations nearest to your site. You need a station name for the order.
distance is in kilometers. Add year, month, day and hour (UTC) to list only stations that have data at that time.
Step 3: Check the data quality¶
Before you order, check that the station has good data for your time range. An order for poor data fails with code 310. This call needs no token.
$start = [DateTimeOffset]::new(2024, 6, 22, 0, 0, 0, [TimeSpan]::Zero).ToUnixTimeMilliseconds()
$end = $start + 86400000
$check = @{ station = "G001"; start = $start; end = $end } | ConvertTo-Json
(Invoke-RestMethod -Method Post -Uri "https://ppk.geodnet.com/api/user/check/station/epoch-ratio" `
-ContentType "application/json" -Body $check).data
start and end are Unix time in milliseconds (UTC). The example is 22 June 2024, 00:00 to 23 June, 00:00. Keep the range inside one UTC day, aligned to the hour.
Convert a date to milliseconds
Each of these prints 1719014400000, which is 22 June 2024, 00:00 UTC. Add 86400000 for one more day.
Read the result:
| Field | Meaning |
|---|---|
ratio |
Share of expected epochs the station recorded, in percent. At least 90 is required. |
mp12 |
Average multipath indicator. At most 0.7 is allowed. |
qualified |
true when the data passes every check. If it is false, choose another station or time range. |
Step 4: Order the data¶
Place an order with the station and the time range. This example orders RINEX 3.04 for one station over one UTC day.
ORDER=$(curl -s -X POST "https://ppk.geodnet.com/api/user/download" \
-H "Content-Type: application/json" \
-H "token: $TOKEN" \
-d '{
"startYear": 2024, "startMonth": 6, "startDay": 22, "startHour": 0,
"endYear": 2024, "endMonth": 6, "endDay": 22, "endHour": 23,
"stations": ["G001"],
"type": 2,
"fileType": 1
}' | jq -r '.data.orderId')
$order = @{
startYear = 2024; startMonth = 6; startDay = 22; startHour = 0
endYear = 2024; endMonth = 6; endDay = 22; endHour = 23
stations = @("G001"); type = 2; fileType = 1
} | ConvertTo-Json
$orderId = (Invoke-RestMethod -Method Post -Uri "https://ppk.geodnet.com/api/user/download" `
-Headers @{ token = $token } -ContentType "application/json" -Body $order).data.orderId
Save the order as order.json:
{
"startYear": 2024, "startMonth": 6, "startDay": 22, "startHour": 0,
"endYear": 2024, "endMonth": 6, "endDay": 22, "endHour": 23,
"stations": ["G001"],
"type": 2,
"fileType": 1
}
Then send it:
curl -s -X POST "https://ppk.geodnet.com/api/user/download" -H "Content-Type: application/json" -H "token: %TOKEN%" -d @order.json
Copy the orderId from the reply and store it:
| Field | What to enter |
|---|---|
stations |
The station name from step 2 |
startYear … endHour |
The time range, in UTC |
type |
1 for all epochs, 2 for 30-second epochs |
fileType |
1 for RINEX 3.04, 2 for RINEX 2.11, 0 for RTCM |
Limits to know
- The time range of one order cannot exceed 30 days. For a longer period, place several orders. How far back data is kept is TBD.
- RINEX files: one station per request, and the range must stay inside one UTC day. For several days or stations, place one order for each.
- The station data must pass GEODNET's quality check, or the order fails.
- Your account needs enough balance.
NRCAN results
The steps are the same for NRCAN results, except step 4 calls /api/user/estimation/download with startDate, endDate and station.
Step 5: Wait until it is ready¶
Check the order status until it is completed.
status is 1 while processing, 2 when completed and 3 if it failed.
Wait automatically (Bash)
Step 6: Download the file¶
You get a zip file with the RINEX files for the period you ordered, ready to load into your PPK software.
Ordered RTCM instead? Convert it to RINEX
RTCM orders (fileType 0) can cover several days and stations. Convert the files to RINEX before use:
- Get
convbin, the converter in the open-source RTKLIB project. The repository includes a Windows build; build it from source for Linux or macOS. TBD Confirm that this version reads GEODNET RTCM files. - Unzip your download and run:
| Placeholder | What to enter |
|---|---|
year/mon/day hour:min:sec |
The approximate time of the RTCM log file, for example 2024/06/22 00:00:00. This is the time of the data, not when you downloaded it. |
your_rtcm_file |
The unzipped RTCM file |
Add -v 2.11 to get the RINEX 2.11 legacy version.