Get Shipment Locations
Use this API to get the location history (GPS breadcrumbs) of a shipment. It returns the valid locations that the FourKites loads page shows for the shipment, from the oldest to the newest by locatedAt. The planned route, stop markers and rejected locations are not included.
The data you receive is the same data your own users see in FourKites, with the same company scoping and carrier data-sharing rules.
Access
This API is available only to companies that FourKites has enabled for it. If you would like to use it, please reach out to your FourKites Customer Success Manager (CSM), who will enable it for your company. Until it is enabled, requests return a 403 error.
Rate Limit
The rate limit is applied per API key and is shared across all Developer Portal APIs used with that key.
Click here for more information on Rate Limit.
Format Supported
JSON
Authenticated Resource
API Key
All timestamps are in UTC, in RFC 3339 format and whole seconds, for example 2026-11-18T14:02:11Z.
For more information on Authentication, click here.
Get Shipment Locations
GET /shipments/{fourKitesShipmentID}/locations
Only the apikey header and the fourKitesShipmentID are required. All query parameters are optional.
- fourKitesShipmentIDstringrequiredDescription
- sincestringDescription
- untilstringDescription
- updatedSincestringDescription
- pageSizeintegerDescription
- pageTokenstringDescription
- apikeystringrequiredDescription
curl --location 'https://api.fourkites.com/shipments/94826232/locations' \
--header 'apikey: REPLACE_KEY_VALUE'OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.fourkites.com/shipments/94826232/locations")
.method("GET", null)
.addHeader("apikey", "REPLACE_KEY_VALUE")
.build();
Response response = client.newCall(request).execute();var settings = {
"url": "https://api.fourkites.com/shipments/94826232/locations",
"method": "GET",
"timeout": 0,
"headers": {
"apikey": "REPLACE_KEY_VALUE"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.fourkites.com/shipments/94826232/locations")!,timeoutInterval: Double.infinity)
request.addValue("REPLACE_KEY_VALUE", forHTTPHeaderField: "apikey")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
var client = new RestClient("https://api.fourkites.com/shipments/94826232/locations");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("apikey", "REPLACE_KEY_VALUE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.fourkites.com/shipments/94826232/locations"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("apikey", "REPLACE_KEY_VALUE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}require "uri"
require "net/http"
url = URI("https://api.fourkites.com/shipments/94826232/locations")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = "REPLACE_KEY_VALUE"
response = https.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.fourkites.com")
payload = ''
headers = {
'apikey': 'REPLACE_KEY_VALUE'
}
conn.request("GET", "/shipments/94826232/locations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")){
"data": {
"fourKitesShipmentID": "94826232",
"from": "2026-11-18T14:02:11Z",
"to": "2026-11-21T09:40:03Z",
"locations": [
{
"id": "Qm9hZ2VzX2xvY2F0aW9u",
"latitude": 41.8781,
"longitude": -87.6298,
"locatedAt": "2026-11-18T14:02:11Z",
"recordedAt": "2026-11-18T14:02:15Z",
"locationName": "Chicago, IL",
"source": "ELD"
}
]
},
"requestId": "brlfhvhghpuac6sl1jrg"
}{
"errorCode": 2002,
"errorMessage": "updatedSince cannot be combined with since; use updatedSince alone for incremental sync, or since/until for a history window",
"errorDetails": [
"updatedSince"
],
"occurredAt": "2026-11-24T09:33:37Z",
"requestId": "dc2ljs9r4elur1uf11cg"
}- fourKitesShipmentIDstringrequiredDescription
- sincestringDescription
- untilstringDescription
- updatedSincestringDescription
- pageSizeintegerDescription
- pageTokenstringDescription
- apikeystringrequiredDescription
curl --location 'https://api-staging.fourkites.com/shipments/94826232/locations' \
--header 'apikey: REPLACE_KEY_VALUE'OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api-staging.fourkites.com/shipments/94826232/locations")
.method("GET", null)
.addHeader("apikey", "REPLACE_KEY_VALUE")
.build();
Response response = client.newCall(request).execute();var settings = {
"url": "https://api-staging.fourkites.com/shipments/94826232/locations",
"method": "GET",
"timeout": 0,
"headers": {
"apikey": "REPLACE_KEY_VALUE"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api-staging.fourkites.com/shipments/94826232/locations")!,timeoutInterval: Double.infinity)
request.addValue("REPLACE_KEY_VALUE", forHTTPHeaderField: "apikey")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
var client = new RestClient("https://api-staging.fourkites.com/shipments/94826232/locations");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("apikey", "REPLACE_KEY_VALUE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api-staging.fourkites.com/shipments/94826232/locations"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("apikey", "REPLACE_KEY_VALUE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}require "uri"
require "net/http"
url = URI("https://api-staging.fourkites.com/shipments/94826232/locations")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = "REPLACE_KEY_VALUE"
response = https.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api-staging.fourkites.com")
payload = ''
headers = {
'apikey': 'REPLACE_KEY_VALUE'
}
conn.request("GET", "/shipments/94826232/locations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")){
"data": {
"fourKitesShipmentID": "94826232",
"from": "2026-11-18T14:02:11Z",
"to": "2026-11-21T09:40:03Z",
"locations": [
{
"id": "Qm9hZ2VzX2xvY2F0aW9u",
"latitude": 41.8781,
"longitude": -87.6298,
"locatedAt": "2026-11-18T14:02:11Z",
"recordedAt": "2026-11-18T14:02:15Z",
"locationName": "Chicago, IL",
"source": "ELD"
}
]
},
"requestId": "brlfhvhghpuac6sl1jrg"
}{
"errorCode": 2002,
"errorMessage": "updatedSince cannot be combined with since; use updatedSince alone for incremental sync, or since/until for a history window",
"errorDetails": [
"updatedSince"
],
"occurredAt": "2026-11-24T09:33:37Z",
"requestId": "dc2ljs9r4elur1uf11cg"
}Response Attributes
Name | Format | Description |
|---|---|---|
fourKitesShipmentID | String | The shipment the history belongs to. |
from | Date-time | Start of the window the response covers. |
to | Date-time | End of the window the response covers. After an updatedSince call, use it as the next updatedSince. |
locations | Location array | The locations, oldest first. |
nextPageToken | String | Present only when more locations exist. Send it as pageToken to get the next page. |
Location
Name | Format | Description |
|---|---|---|
id | String | Opaque identifier of the location (22 URL-safe characters). It is the same on every read of this shipment, so use it to remove duplicates. Do not parse it. |
latitude | Number | Latitude in decimal degrees. |
longitude | Number | Longitude in decimal degrees. |
locatedAt | Date-time | When the shipment was at this location. |
recordedAt | Date-time | When FourKites recorded this location. It can be much later than locatedAt, for example when a device was offline or a feed was late. |
locationName | String or null | Name of the location, when known. |
source | String or null | Source of the location (for example ELD), as shown in the Source column of the loads page. It is always null for shipments that are not truckload. New values can appear. |
Paging
Most calls need no paging. A single call with only the apikey header and the fourKitesShipmentID returns the full history for the vast majority of shipments. When a shipment has more than 1000 locations, the response is split into pages:
- Call the API as usual.
- If the response contains a nextPageToken, call the same URL again with pageToken=<that value> and the same since, until or updatedSince you sent the first time.
- Repeat while a nextPageToken is present. The last page has no nextPageToken.
A page token is valid for 24 hours. If a token is refused with a 400 error, start again from the first page without it. Treat the token as an opaque string and do not edit or build it yourself.
Keeping Your Own Copy Up to Date
This section is optional. Use it only if you store locations on your side and want to refresh them without reading the full history each time.
- Make one plain call for the shipment and store the locations by id.
- Later, call the API with updatedSince set to the time of your last sync (the first time, the time of your plain call).
- Store what comes back by id. An item you already have is replaced, not duplicated.
- Once you have read the last page, use the to value of the response as updatedSince in your next call.
updatedSince returns the items FourKites recorded at or after that time, up to 2 minutes before your request, so data that is still being written is not skipped. Use it instead of since for syncing: since filters on when the event happened, and an item that reaches FourKites late can have an older locatedAt than your last sync.
To avoid unnecessary load, do not request the same shipment more often than once every 15 minutes.
Status Codes and Errors
Code | Status | When |
|---|---|---|
200 | OK | The history is returned. The list can be empty, for example when the shipment is not tracked yet or the window has no data. |
400 | Bad Request | A bad parameter: a timestamp that is not RFC 3339, since after until, a window longer than 31 days, updatedSince combined with since or until, or a pageToken that was changed, is older than 24 hours, or belongs to another shipment, window or API key. errorDetails names the parameter. |
401 | Unauthorized | The API key is missing or invalid. |
403 | Forbidden | Your company is not enabled for this API. Please contact your FourKites Customer Success Manager (CSM). |
404 | Not Found | The shipment does not exist or is not visible to your company. |
429 | Too Many Requests | The API key used up its rate limit. Retry after a short wait. |
500 | Internal Server Error | Please try again later. |
504 | Gateway Timeout | The tracking data did not arrive in time. Please try again later. |
Errors use the standard FourKites error format (errorCode, errorMessage, errorDetails, occurredAt, requestId). See the Status Code and Errors page for details.
Response Headers
Header | Meaning |
|---|---|
X-FourKites-Skipped-Rows: N | N stored rows were not valid and were left out of the response. Call again later to get the corrected rows. |
X-FourKites-Truncated: true | Paging is temporarily unavailable and only the first page was returned. For a sync, continue from the to value. For a full read, call again later. |
Cache-Control: no-store | The response must not be cached by clients or proxies. |
