Get border crossing recommendations
curl --request POST \
--url https://api.cargado.com/border-crossings/recommendations \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"requests": [
{
"stops": [
{
"type": "PICKUP",
"placeDetails": {
"place": {
"address": "<string>",
"type": "ADDRESS_STRING"
}
}
}
],
"trailerRequirements": {
"allowedTypes": []
}
}
]
}
'import requests
url = "https://api.cargado.com/border-crossings/recommendations"
payload = { "requests": [
{
"stops": [
{
"type": "PICKUP",
"placeDetails": { "place": {
"address": "<string>",
"type": "ADDRESS_STRING"
} }
}
],
"trailerRequirements": { "allowedTypes": [] }
}
] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
stops: [
{
type: 'PICKUP',
placeDetails: {place: {address: '<string>', type: 'ADDRESS_STRING'}}
}
],
trailerRequirements: {allowedTypes: []}
}
]
})
};
fetch('https://api.cargado.com/border-crossings/recommendations', 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.cargado.com/border-crossings/recommendations",
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([
'requests' => [
[
'stops' => [
[
'type' => 'PICKUP',
'placeDetails' => [
'place' => [
'address' => '<string>',
'type' => 'ADDRESS_STRING'
]
]
]
],
'trailerRequirements' => [
'allowedTypes' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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.cargado.com/border-crossings/recommendations"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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.cargado.com/border-crossings/recommendations")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cargado.com/border-crossings/recommendations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"type": "DATA",
"stops": [
{
"type": "PICKUP",
"placeDetails": {
"place": {
"address": "<string>",
"type": "ADDRESS_STRING"
},
"coordinates": {
"latitude": 0,
"longitude": 0
}
}
}
],
"trailerRequirements": {
"allowedTypes": []
},
"recommendedBorderCrossings": []
}
]
}{
"message": "Unauthorized"
}Border Crossings
Get border crossing recommendations
Get recommended US-Mexico border crossings for one or more routes. Returns recommended crossings filtered by confidence threshold, in the same order as the input requests. Routes that do not cross the US-Mexico border will return an error result.
POST
/
border-crossings
/
recommendations
Get border crossing recommendations
curl --request POST \
--url https://api.cargado.com/border-crossings/recommendations \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"requests": [
{
"stops": [
{
"type": "PICKUP",
"placeDetails": {
"place": {
"address": "<string>",
"type": "ADDRESS_STRING"
}
}
}
],
"trailerRequirements": {
"allowedTypes": []
}
}
]
}
'import requests
url = "https://api.cargado.com/border-crossings/recommendations"
payload = { "requests": [
{
"stops": [
{
"type": "PICKUP",
"placeDetails": { "place": {
"address": "<string>",
"type": "ADDRESS_STRING"
} }
}
],
"trailerRequirements": { "allowedTypes": [] }
}
] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
stops: [
{
type: 'PICKUP',
placeDetails: {place: {address: '<string>', type: 'ADDRESS_STRING'}}
}
],
trailerRequirements: {allowedTypes: []}
}
]
})
};
fetch('https://api.cargado.com/border-crossings/recommendations', 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.cargado.com/border-crossings/recommendations",
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([
'requests' => [
[
'stops' => [
[
'type' => 'PICKUP',
'placeDetails' => [
'place' => [
'address' => '<string>',
'type' => 'ADDRESS_STRING'
]
]
]
],
'trailerRequirements' => [
'allowedTypes' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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.cargado.com/border-crossings/recommendations"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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.cargado.com/border-crossings/recommendations")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cargado.com/border-crossings/recommendations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"stops\": [\n {\n \"type\": \"PICKUP\",\n \"placeDetails\": {\n \"place\": {\n \"address\": \"<string>\",\n \"type\": \"ADDRESS_STRING\"\n }\n }\n }\n ],\n \"trailerRequirements\": {\n \"allowedTypes\": []\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"type": "DATA",
"stops": [
{
"type": "PICKUP",
"placeDetails": {
"place": {
"address": "<string>",
"type": "ADDRESS_STRING"
},
"coordinates": {
"latitude": 0,
"longitude": 0
}
}
}
],
"trailerRequirements": {
"allowedTypes": []
},
"recommendedBorderCrossings": []
}
]
}{
"message": "Unauthorized"
}Authorizations
Body
application/json
Input for looking up recommended border crossings for one or more routes.
A list of routes to get border crossing recommendations for.
Required array length:
1 - 50 elementsShow child attributes
Show child attributes
Response
Ok
Output containing border crossing recommendations for each requested route, in the same order as the input requests.
- Option 1
- Option 2
Show child attributes
Show child attributes
⌘I

