Client libraries
ShipGrid does not publish an official SDK or package at this time. The API is plain HTTPS + JSON: any HTTP client in any language works with your API key in the Authorization header.
Do not install packages that claim to be a ShipGrid SDK — for example
@shipgrid/sdk, ShipGrid-sdk, shipgrid/php-sdk or anything under github.com/shipgrid. They are not published by us. If you installed one, remove it and rotate your API key.Call the API directly
curl
curl -X POST https://shipgrid.ai/api/v1/rates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_address": { "name": "Your Store", "street1": "123 Store Street", "city": "San Francisco", "state": "CA", "zip": "94102" },
"to_address": { "name": "John Customer", "street1": "456 Customer Ave", "city": "Los Angeles", "state": "CA", "zip": "90210" },
"parcel": { "weight": 16, "length": 12, "width": 8, "height": 6 }
}'JavaScript / TypeScript (built-in fetch)
const res = await fetch('https://shipgrid.ai/api/v1/rates', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.SHIPGRID_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ /* same body as the curl example */ }),
})
const data = await res.json()Python (requests)
import os, requests
res = requests.post(
"https://shipgrid.ai/api/v1/rates",
headers={"Authorization": f"Bearer {os.environ['SHIPGRID_API_KEY']}"},
json={ ... }, # same body as the curl example
)
data = res.json()Need typed models? Generate a client from the OpenAPI description used by the API reference with any OpenAPI generator you trust.
