Get Realtime Positions
curl --request POST \
--url https://api.pathstack.io/realtime/device \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"connection_ids": [
"<string>"
],
"tags": [
"<string>"
],
"device_ids": [
"<string>"
],
"connection_devices": [
{
"connection_id": "<string>",
"system_device_ids": [
"<string>"
]
}
]
},
"options": {
"include_speed": true,
"include_driver_id": true
}
}
'import requests
url = "https://api.pathstack.io/realtime/device"
payload = {
"filters": {
"connection_ids": ["<string>"],
"tags": ["<string>"],
"device_ids": ["<string>"],
"connection_devices": [
{
"connection_id": "<string>",
"system_device_ids": ["<string>"]
}
]
},
"options": {
"include_speed": True,
"include_driver_id": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
connection_ids: ['<string>'],
tags: ['<string>'],
device_ids: ['<string>'],
connection_devices: [{connection_id: '<string>', system_device_ids: ['<string>']}]
},
options: {include_speed: true, include_driver_id: true}
})
};
fetch('https://api.pathstack.io/realtime/device', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pathstack.io/realtime/device",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'connection_ids' => [
'<string>'
],
'tags' => [
'<string>'
],
'device_ids' => [
'<string>'
],
'connection_devices' => [
[
'connection_id' => '<string>',
'system_device_ids' => [
'<string>'
]
]
]
],
'options' => [
'include_speed' => true,
'include_driver_id' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pathstack.io/realtime/device"
payload := strings.NewReader("{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pathstack.io/realtime/device")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathstack.io/realtime/device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"connection_id": "<string>",
"device_id": "<string>",
"system_device_id": "<string>",
"position": {
"timestamp": "<string>",
"longitude": 123,
"latitude": 123,
"heading": 123,
"speed": {
"speed_kph": 123
},
"driver_id": {
"value": "<string>"
}
}
}
]
}{
"error": {
"code": 400,
"message": "Invalid JWT format"
}
}{
"error": {
"code": 401,
"message": "Authentication header is missing, or token is invalid/expired."
}
}{
"error": {
"code": 403,
"message": "You do not have access to this resource"
}
}{
"error": {
"code": 404,
"message": "Unknown device_ids <string>, ..."
}
}{
"error": {
"code": 422,
"message": "Field required",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
}Real-time
Get Realtime Positions
This endpoint returns the most recent Position of each Device. You can optionally pass in filter_parameters to filter the devices you will receive.
POST
/
realtime
/
device
Get Realtime Positions
curl --request POST \
--url https://api.pathstack.io/realtime/device \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"connection_ids": [
"<string>"
],
"tags": [
"<string>"
],
"device_ids": [
"<string>"
],
"connection_devices": [
{
"connection_id": "<string>",
"system_device_ids": [
"<string>"
]
}
]
},
"options": {
"include_speed": true,
"include_driver_id": true
}
}
'import requests
url = "https://api.pathstack.io/realtime/device"
payload = {
"filters": {
"connection_ids": ["<string>"],
"tags": ["<string>"],
"device_ids": ["<string>"],
"connection_devices": [
{
"connection_id": "<string>",
"system_device_ids": ["<string>"]
}
]
},
"options": {
"include_speed": True,
"include_driver_id": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
connection_ids: ['<string>'],
tags: ['<string>'],
device_ids: ['<string>'],
connection_devices: [{connection_id: '<string>', system_device_ids: ['<string>']}]
},
options: {include_speed: true, include_driver_id: true}
})
};
fetch('https://api.pathstack.io/realtime/device', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pathstack.io/realtime/device",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'connection_ids' => [
'<string>'
],
'tags' => [
'<string>'
],
'device_ids' => [
'<string>'
],
'connection_devices' => [
[
'connection_id' => '<string>',
'system_device_ids' => [
'<string>'
]
]
]
],
'options' => [
'include_speed' => true,
'include_driver_id' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pathstack.io/realtime/device"
payload := strings.NewReader("{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pathstack.io/realtime/device")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathstack.io/realtime/device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"connection_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"device_ids\": [\n \"<string>\"\n ],\n \"connection_devices\": [\n {\n \"connection_id\": \"<string>\",\n \"system_device_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"options\": {\n \"include_speed\": true,\n \"include_driver_id\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"connection_id": "<string>",
"device_id": "<string>",
"system_device_id": "<string>",
"position": {
"timestamp": "<string>",
"longitude": 123,
"latitude": 123,
"heading": 123,
"speed": {
"speed_kph": 123
},
"driver_id": {
"value": "<string>"
}
}
}
]
}{
"error": {
"code": 400,
"message": "Invalid JWT format"
}
}{
"error": {
"code": 401,
"message": "Authentication header is missing, or token is invalid/expired."
}
}{
"error": {
"code": 403,
"message": "You do not have access to this resource"
}
}{
"error": {
"code": 404,
"message": "Unknown device_ids <string>, ..."
}
}{
"error": {
"code": 422,
"message": "Field required",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Response
Successful Response
Successful response payload
- RealtimeValidState
- RealtimeTimeoutState
Show child attributes
Show child attributes
⌘I

