Skip to content

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 curl and jq (jq picks a value out of the JSON reply). PowerShell needs nothing extra. CMD uses curl.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.

TOKEN=$(curl -s -X POST "https://ppk.geodnet.com/api/user/signin" \
  -H "Content-Type: application/json" \
  -d '{"username": "geoduser", "password": "geodpass"}' \
  | jq -r '.data.token')
$body = @{ username = "geoduser"; password = "geodpass" } | ConvertTo-Json
$token = (Invoke-RestMethod -Method Post -Uri "https://ppk.geodnet.com/api/user/signin" `
  -ContentType "application/json" -Body $body).data.token
curl -s -X POST "https://ppk.geodnet.com/api/user/signin" -H "Content-Type: application/json" -d "{\"username\": \"geoduser\", \"password\": \"geodpass\"}"

Copy the token value from the reply, then store it:

set TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
{
  "code": 200,
  "message": "Success",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

Step 2: Find a station

Ask for the stations nearest to your site. You need a station name for the order.

curl -s -G "https://ppk.geodnet.com/api/user/station" \
  -H "token: $TOKEN" \
  --data-urlencode "longitude=10" \
  --data-urlencode "latitude=20"
$stations = Invoke-RestMethod -Uri "https://ppk.geodnet.com/api/user/station?longitude=10&latitude=20" `
  -Headers @{ token = $token }
$stations.data.stations
curl -s -G "https://ppk.geodnet.com/api/user/station" -H "token: %TOKEN%" --data-urlencode "longitude=10" --data-urlencode "latitude=20"
{
  "code": 200,
  "message": "Success",
  "data": {
    "stations": [
      { "name": "G001", "distance": 10.23 },
      { "name": "G002", "distance": 60.11 }
    ]
  }
}

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.

curl -s -X POST "https://ppk.geodnet.com/api/user/check/station/epoch-ratio" \
  -H "Content-Type: application/json" \
  -d '{"station": "G001", "start": 1719014400000, "end": 1719100800000}'
$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
curl -s -X POST "https://ppk.geodnet.com/api/user/check/station/epoch-ratio" -H "Content-Type: application/json" -d "{\"station\": \"G001\", \"start\": 1719014400000, \"end\": 1719100800000}"
{
  "code": 200,
  "message": "Success",
  "data": {
    "station": "G001",
    "start": 1719014400000,
    "end": 1719100800000,
    "ratio": 99.92,
    "mp12": 0.1356,
    "qualified": true
  }
}

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.

date -u -d "2024-06-22 00:00:00" +%s000
date -u -j -f "%Y-%m-%d %H:%M:%S" "2024-06-22 00:00:00" +%s000
[DateTimeOffset]::new(2024, 6, 22, 0, 0, 0, [TimeSpan]::Zero).ToUnixTimeMilliseconds()
from datetime import datetime, timezone
int(datetime(2024, 6, 22, tzinfo=timezone.utc).timestamp() * 1000)
Date.UTC(2024, 5, 22)  // months start at 0, so 5 is June

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:

set ORDER=667bebbe9f32c8ef2dd4643f
{
  "code": 200,
  "message": "Success",
  "data": {
    "orderId": "667bebbe9f32c8ef2dd4643f"
  }
}
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.

curl -s "https://ppk.geodnet.com/api/download/status/$ORDER" \
  -H "token: $TOKEN"
(Invoke-RestMethod -Uri "https://ppk.geodnet.com/api/download/status/$orderId" `
  -Headers @{ token = $token }).data.status
curl -s "https://ppk.geodnet.com/api/download/status/%ORDER%" -H "token: %TOKEN%"
{
  "code": 200,
  "message": "Success",
  "data": { "status": 2 }
}

status is 1 while processing, 2 when completed and 3 if it failed.

Wait automatically (Bash)
while true; do
  STATUS=$(curl -s "https://ppk.geodnet.com/api/download/status/$ORDER" \
    -H "token: $TOKEN" | jq -r '.data.status')
  if [ "$STATUS" = "2" ]; then echo "Completed"; break
  elif [ "$STATUS" = "3" ]; then echo "Failed"; exit 1
  else echo "Processing..."; sleep 5
  fi
done

Step 6: Download the file

curl -L "https://ppk.geodnet.com/api/download/$ORDER" \
  -H "token: $TOKEN" \
  -o "geodnet_${ORDER}.zip"
Invoke-WebRequest -Uri "https://ppk.geodnet.com/api/download/$orderId" `
  -Headers @{ token = $token } -OutFile "geodnet_$orderId.zip"
curl -L "https://ppk.geodnet.com/api/download/%ORDER%" -H "token: %TOKEN%" -o "geodnet_%ORDER%.zip"

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:

  1. 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.
  2. Unzip your download and run:
convbin.exe -r rtcm3 -tr year/mon/day hour:min:sec your_rtcm_file
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.