---
title: Get Shipment Locations
slug: fourkites-api-reference/cx1oh5ejovk5cwfbijcsz
icon: {"apiMethod":"GET"}
createdAt: 2026-11-27T06:02:25.000Z
---

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.

:::hint{type="warning"}
### 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.
:::

:::hint{type="info"}
### Rate Limit

The rate limit is applied per API key and is shared across all Developer Portal APIs used with that key.

[Click here](https://docs.fourkites.com/api-reference/rate-limits) for more information on Rate Limit.
:::

:::hint{type="info"}
### Format Supported

**JSON**
:::

:::hint{type="info"}
### Authenticated Resource

**API Key**
:::

:::hint{type="success"}
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](https://docs.fourkites.com/api-reference/authentication).

## Get Shipment Locations

`GET /shipments/{fourKitesShipmentID}/locations`

Only the `apikey` header and the `fourKitesShipmentID` are required. All query parameters are optional.

:::ApiMethodV2
```json
{
  "name": "Production",
  "method": "GET",
  "url": "https://api.fourkites.com/shipments/{fourKitesShipmentID}/locations",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "Llh2InLSM_eF0s0KHk4wS",
        "language": "curl",
        "code": "curl --location 'https://api.fourkites.com/shipments/94826232/locations' \\\n--header 'apikey: REPLACE_KEY_VALUE'",
        "customLabel": ""
      },
      {
        "id": "lDDgwd4JDLftVuxqifwNC",
        "language": "java",
        "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n  .build();\nRequest request = new Request.Builder()\n  .url(\"https://api.fourkites.com/shipments/94826232/locations\")\n  .method(\"GET\", null)\n  .addHeader(\"apikey\", \"REPLACE_KEY_VALUE\")\n  .build();\nResponse response = client.newCall(request).execute();",
        "customLabel": ""
      },
      {
        "id": "f_ANVPztgM3-hh1wWUXx4",
        "language": "javascript",
        "code": "var settings = {\n  \"url\": \"https://api.fourkites.com/shipments/94826232/locations\",\n  \"method\": \"GET\",\n  \"timeout\": 0,\n  \"headers\": {\n    \"apikey\": \"REPLACE_KEY_VALUE\"\n  },\n};\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});",
        "customLabel": ""
      },
      {
        "id": "Em6tRPa_I51NqtEFPA-mx",
        "language": "swift",
        "code": "import Foundation\n#if canImport(FoundationNetworking)\nimport FoundationNetworking\n#endif\n\nvar semaphore = DispatchSemaphore (value: 0)\n\nvar request = URLRequest(url: URL(string: \"https://api.fourkites.com/shipments/94826232/locations\")!,timeoutInterval: Double.infinity)\nrequest.addValue(\"REPLACE_KEY_VALUE\", forHTTPHeaderField: \"apikey\")\n\nrequest.httpMethod = \"GET\"\n\nlet task = URLSession.shared.dataTask(with: request) { data, response, error in \n  guard let data = data else {\n    print(String(describing: error))\n    semaphore.signal()\n    return\n  }\n  print(String(data: data, encoding: .utf8)!)\n  semaphore.signal()\n}\n\ntask.resume()\nsemaphore.wait()\n",
        "customLabel": ""
      },
      {
        "id": "kam1R9sdjSx8zGeodR7Kq",
        "language": "csharp",
        "code": "var client = new RestClient(\"https://api.fourkites.com/shipments/94826232/locations\");\nclient.Timeout = -1;\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"apikey\", \"REPLACE_KEY_VALUE\");\nIRestResponse response = client.Execute(request);\nConsole.WriteLine(response.Content);",
        "customLabel": ""
      },
      {
        "id": "we2rdhAjVMOioToKufR71",
        "language": "go",
        "code": "package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n\n  url := \"https://api.fourkites.com/shipments/94826232/locations\"\n  method := \"GET\"\n\n  client := &http.Client {\n  }\n  req, err := http.NewRequest(method, url, nil)\n\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  req.Header.Add(\"apikey\", \"REPLACE_KEY_VALUE\")\n\n  res, err := client.Do(req)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  defer res.Body.Close()\n\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  fmt.Println(string(body))\n}",
        "customLabel": ""
      },
      {
        "id": "RHzstuDG2wTzHxEVUQSs8",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fourkites.com/shipments/94826232/locations\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"apikey\"] = \"REPLACE_KEY_VALUE\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      },
      {
        "id": "jru2VYPhav9F_XO9Bn6Zz",
        "language": "python",
        "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api.fourkites.com\")\npayload = ''\nheaders = {\n  'apikey': 'REPLACE_KEY_VALUE'\n}\nconn.request(\"GET\", \"/shipments/94826232/locations\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "Llh2InLSM_eF0s0KHk4wS"
  },
  "results": {
    "languages": [
      {
        "id": "4XpnWZZlOO1F5WXO9n_cj",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"data\": {\n    \"fourKitesShipmentID\": \"94826232\",\n    \"from\": \"2026-11-18T14:02:11Z\",\n    \"to\": \"2026-11-21T09:40:03Z\",\n    \"locations\": [\n      {\n        \"id\": \"Qm9hZ2VzX2xvY2F0aW9u\",\n        \"latitude\": 41.8781,\n        \"longitude\": -87.6298,\n        \"locatedAt\": \"2026-11-18T14:02:11Z\",\n        \"recordedAt\": \"2026-11-18T14:02:15Z\",\n        \"locationName\": \"Chicago, IL\",\n        \"source\": \"ELD\"\n      }\n    ]\n  },\n  \"requestId\": \"brlfhvhghpuac6sl1jrg\"\n}"
      },
      {
        "id": "i7FRRRDuo8bXfNoYE8VxJ",
        "language": "400",
        "customLabel": "",
        "code": "{\n  \"errorCode\": 2002,\n  \"errorMessage\": \"updatedSince cannot be combined with since; use updatedSince alone for incremental sync, or since/until for a history window\",\n  \"errorDetails\": [\n    \"updatedSince\"\n  ],\n  \"occurredAt\": \"2026-11-24T09:33:37Z\",\n  \"requestId\": \"dc2ljs9r4elur1uf11cg\"\n}"
      }
    ],
    "selectedLanguageId": "4XpnWZZlOO1F5WXO9n_cj"
  },
  "request": {
    "pathParameters": [
      {
        "name": "fourKitesShipmentID",
        "kind": "required",
        "type": "string",
        "description": "FourKites generated identifier of the shipment. You can get it from the Get shipments list and Get shipment detail APIs. Ex: \"94826232\"",
        "children": []
      }
    ],
    "queryParameters": [
      {
        "name": "since",
        "kind": "optional",
        "type": "string",
        "description": "Start of the time window on locatedAt, inclusive. RFC 3339 date-time in UTC. If you send since without until, the window ends at the time of your request. The window can be at most 31 days. URL-encode a + sign as %2B. Default: the start of the shipment. Ex: \"2026-11-01T00:00:00Z\"",
        "children": []
      },
      {
        "name": "until",
        "kind": "optional",
        "type": "string",
        "description": "End of the time window on locatedAt, exclusive. RFC 3339 date-time in UTC. If you send neither since nor until, the whole history is returned. Ex: \"2026-11-08T00:00:00Z\"",
        "children": []
      },
      {
        "name": "updatedSince",
        "kind": "optional",
        "type": "string",
        "description": "Returns only the items FourKites recorded at or after this time (based on recordedAt), up to 2 minutes before your request. Use it to keep your own copy up to date. It cannot be combined with since or until. Ex: \"2026-11-20T10:00:00Z\"",
        "children": []
      },
      {
        "name": "pageSize",
        "kind": "optional",
        "type": "integer",
        "description": "Number of items per page, from 1 to 1000. Larger values are served as 1000. Default: 1000. Ex: 500",
        "children": []
      },
      {
        "name": "pageToken",
        "kind": "optional",
        "type": "string",
        "description": "Send this only when the previous response contained a nextPageToken. Pass that value exactly as received, together with the same since, until or updatedSince you used before. The token is opaque and valid for 24 hours.",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "apikey",
        "kind": "required",
        "type": "string",
        "description": "Your Developer Portal API key. The same key you use for the other FourKites APIs.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "production",
  "legacyHash": "UVCPSha0QPGsUf1hnhP44"
}
```
:::

:::ApiMethodV2
```json
{
  "name": "Staging",
  "method": "GET",
  "url": "https://api-staging.fourkites.com/shipments/{fourKitesShipmentID}/locations",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "VB4nVgh9UrXdoMDFA1Upi",
        "language": "curl",
        "code": "curl --location 'https://api-staging.fourkites.com/shipments/94826232/locations' \\\n--header 'apikey: REPLACE_KEY_VALUE'",
        "customLabel": ""
      },
      {
        "id": "WKK1tltoBrmqaAiN4qORT",
        "language": "java",
        "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n  .build();\nRequest request = new Request.Builder()\n  .url(\"https://api-staging.fourkites.com/shipments/94826232/locations\")\n  .method(\"GET\", null)\n  .addHeader(\"apikey\", \"REPLACE_KEY_VALUE\")\n  .build();\nResponse response = client.newCall(request).execute();",
        "customLabel": ""
      },
      {
        "id": "COtVHQ7OouiNbYBz903YL",
        "language": "javascript",
        "code": "var settings = {\n  \"url\": \"https://api-staging.fourkites.com/shipments/94826232/locations\",\n  \"method\": \"GET\",\n  \"timeout\": 0,\n  \"headers\": {\n    \"apikey\": \"REPLACE_KEY_VALUE\"\n  },\n};\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});",
        "customLabel": ""
      },
      {
        "id": "3f6tUd3yHZ-pW5f6jM8O8",
        "language": "swift",
        "code": "import Foundation\n#if canImport(FoundationNetworking)\nimport FoundationNetworking\n#endif\n\nvar semaphore = DispatchSemaphore (value: 0)\n\nvar request = URLRequest(url: URL(string: \"https://api-staging.fourkites.com/shipments/94826232/locations\")!,timeoutInterval: Double.infinity)\nrequest.addValue(\"REPLACE_KEY_VALUE\", forHTTPHeaderField: \"apikey\")\n\nrequest.httpMethod = \"GET\"\n\nlet task = URLSession.shared.dataTask(with: request) { data, response, error in \n  guard let data = data else {\n    print(String(describing: error))\n    semaphore.signal()\n    return\n  }\n  print(String(data: data, encoding: .utf8)!)\n  semaphore.signal()\n}\n\ntask.resume()\nsemaphore.wait()\n",
        "customLabel": ""
      },
      {
        "id": "lpoQ8yuKNxVJrl_wVbqaq",
        "language": "csharp",
        "code": "var client = new RestClient(\"https://api-staging.fourkites.com/shipments/94826232/locations\");\nclient.Timeout = -1;\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"apikey\", \"REPLACE_KEY_VALUE\");\nIRestResponse response = client.Execute(request);\nConsole.WriteLine(response.Content);",
        "customLabel": ""
      },
      {
        "id": "px36oZBJiPD2mug-YXYQP",
        "language": "go",
        "code": "package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n\n  url := \"https://api-staging.fourkites.com/shipments/94826232/locations\"\n  method := \"GET\"\n\n  client := &http.Client {\n  }\n  req, err := http.NewRequest(method, url, nil)\n\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  req.Header.Add(\"apikey\", \"REPLACE_KEY_VALUE\")\n\n  res, err := client.Do(req)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  defer res.Body.Close()\n\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  fmt.Println(string(body))\n}",
        "customLabel": ""
      },
      {
        "id": "6QKCCBcw6gM88ydhPUTYC",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-staging.fourkites.com/shipments/94826232/locations\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"apikey\"] = \"REPLACE_KEY_VALUE\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      },
      {
        "id": "51xBkwlxeMw4zEc_tcoME",
        "language": "python",
        "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api-staging.fourkites.com\")\npayload = ''\nheaders = {\n  'apikey': 'REPLACE_KEY_VALUE'\n}\nconn.request(\"GET\", \"/shipments/94826232/locations\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "VB4nVgh9UrXdoMDFA1Upi"
  },
  "results": {
    "languages": [
      {
        "id": "nkIw3fVR0DqDwUf-M_3kq",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"data\": {\n    \"fourKitesShipmentID\": \"94826232\",\n    \"from\": \"2026-11-18T14:02:11Z\",\n    \"to\": \"2026-11-21T09:40:03Z\",\n    \"locations\": [\n      {\n        \"id\": \"Qm9hZ2VzX2xvY2F0aW9u\",\n        \"latitude\": 41.8781,\n        \"longitude\": -87.6298,\n        \"locatedAt\": \"2026-11-18T14:02:11Z\",\n        \"recordedAt\": \"2026-11-18T14:02:15Z\",\n        \"locationName\": \"Chicago, IL\",\n        \"source\": \"ELD\"\n      }\n    ]\n  },\n  \"requestId\": \"brlfhvhghpuac6sl1jrg\"\n}"
      },
      {
        "id": "9oCJ-K8XcPeAxZvIFwfux",
        "language": "400",
        "customLabel": "",
        "code": "{\n  \"errorCode\": 2002,\n  \"errorMessage\": \"updatedSince cannot be combined with since; use updatedSince alone for incremental sync, or since/until for a history window\",\n  \"errorDetails\": [\n    \"updatedSince\"\n  ],\n  \"occurredAt\": \"2026-11-24T09:33:37Z\",\n  \"requestId\": \"dc2ljs9r4elur1uf11cg\"\n}"
      }
    ],
    "selectedLanguageId": "nkIw3fVR0DqDwUf-M_3kq"
  },
  "request": {
    "pathParameters": [
      {
        "name": "fourKitesShipmentID",
        "kind": "required",
        "type": "string",
        "description": "FourKites generated identifier of the shipment. You can get it from the Get shipments list and Get shipment detail APIs. Ex: \"94826232\"",
        "children": []
      }
    ],
    "queryParameters": [
      {
        "name": "since",
        "kind": "optional",
        "type": "string",
        "description": "Start of the time window on locatedAt, inclusive. RFC 3339 date-time in UTC. If you send since without until, the window ends at the time of your request. The window can be at most 31 days. URL-encode a + sign as %2B. Default: the start of the shipment. Ex: \"2026-11-01T00:00:00Z\"",
        "children": []
      },
      {
        "name": "until",
        "kind": "optional",
        "type": "string",
        "description": "End of the time window on locatedAt, exclusive. RFC 3339 date-time in UTC. If you send neither since nor until, the whole history is returned. Ex: \"2026-11-08T00:00:00Z\"",
        "children": []
      },
      {
        "name": "updatedSince",
        "kind": "optional",
        "type": "string",
        "description": "Returns only the items FourKites recorded at or after this time (based on recordedAt), up to 2 minutes before your request. Use it to keep your own copy up to date. It cannot be combined with since or until. Ex: \"2026-11-20T10:00:00Z\"",
        "children": []
      },
      {
        "name": "pageSize",
        "kind": "optional",
        "type": "integer",
        "description": "Number of items per page, from 1 to 1000. Larger values are served as 1000. Default: 1000. Ex: 500",
        "children": []
      },
      {
        "name": "pageToken",
        "kind": "optional",
        "type": "string",
        "description": "Send this only when the previous response contained a nextPageToken. Pass that value exactly as received, together with the same since, until or updatedSince you used before. The token is opaque and valid for 24 hours.",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "name": "apikey",
        "kind": "required",
        "type": "string",
        "description": "Your Developer Portal API key. The same key you use for the other FourKites APIs.",
        "children": []
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "staging",
  "legacyHash": "9uws5EamTfYL5tamDgPJr"
}
```
:::

## 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:

1. Call the API as usual.
2. 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.
3. 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.

1. Make one plain call for the shipment and store the locations by `id`.
2. Later, call the API with `updatedSince` set to the time of your last sync (the first time, the time of your plain call).
3. Store what comes back by `id`. An item you already have is replaced, not duplicated.
4. 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.                                                                                               |

