FedEx APIfedex.com ↗
Access FedEx shipment tracking, country shipping capabilities, address validation, and location search via a structured JSON API with 5 endpoints.
What is the FedEx API?
The FedEx API exposes 5 endpoints covering shipment tracking, address validation, location search, and country-level shipping data. The track_by_tracking_number endpoint returns full scan event history, current package location, estimated delivery window, and delivery status flags for any FedEx tracking number. Country coverage spans over 200 territories with per-country details on states, customs limits, allowed ship dates, and carrier postal awareness.
curl -X GET 'https://api.parse.bot/scraper/9ed4e97f-a431-48ab-93c9-b3fb85713a29/track_by_tracking_number?tracking_number=774212513411' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace fedex-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
FedEx Web API Scraper - Usage Example
Get your API key from: https://parse.bot/settings
"""
import requests
import os
class ParseClient:
"""Client for FedEx Web API Scraper."""
def __init__(self, api_key=None):
self.api_key = api_key or os.getenv("PARSE_API_KEY")
self.base_url = "https://api.parse.bot"
self.scraper_id = "9ed4e97f-a431-48ab-93c9-b3fb85713a29"
def _call(self, endpoint, method="POST", **params):
"""Make API call."""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json",
}
payload = dict(params)
if method.upper() == "GET":
response = requests.get(url, headers=headers, params=payload)
else:
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
return data
def track_by_tracking_number(self, tracking_number):
"""Track a FedEx shipment by tracking number. Returns detailed package status including current location, estimated delivery, scan event history, and delivery status flags. The API always returns a response for any tracking number format; invalid or expired numbers return with a notFound flag and error in the errorList. Paginates implicitly (single request returns all events for one tracking number)."""
return self._call("track_by_tracking_number", method="GET", tracking_number=tracking_number)
def validate_address(self, postal_code, country_code=None):
"""Validate a postal code and country combination."""
return self._call("validate_address", method="GET", postal_code=postal_code, country_code=country_code)
def get_countries(self):
"""Get a list of all countries and territories supported by FedEx with their codes, region, currency, and shipping capabilities including domestic shipping and postal awareness. Returns over 200 countries. No input required."""
return self._call("get_countries", method="GET")
def find_locations(self, postal_code, country_code=None):
"""Search for FedEx locations near a specific postal code."""
return self._call("find_locations", method="GET", postal_code=postal_code, country_code=country_code)
def get_country_details(self, country_code):
"""Get detailed shipping information for a specific country including states/provinces, allowed ship dates, customs value limits, credit card options, postal awareness by carrier, and system of measure. Useful for determining shipping capabilities and constraints for a given destination country."""
return self._call("get_country_details", method="GET", country_code=country_code)
if __name__ == "__main__":
client = ParseClient()
result = client.track_by_tracking_number(tracking_number="<FedEx tracking number (typical>")
print("track_by_tracking_number:", result)
result = client.validate_address(postal_code="<Postal or ZIP code>", country_code="<ISO country code (e.g., US, CA>")
print("validate_address:", result)
result = client.get_countries()
print("get_countries:", result)
result = client.find_locations(postal_code="<Postal or ZIP code>", country_code="<ISO country code>")
print("find_locations:", result)
result = client.get_country_details(country_code="<ISO 2-letter country code (e.g>")
print("get_country_details:", result)
Track a FedEx shipment by tracking number. Returns detailed package status including current location, estimated delivery, scan event history, and delivery status flags. The API always returns a response for any tracking number format; invalid or expired numbers return with a notFound flag and error in the errorList. Paginates implicitly (single request returns all events for one tracking number).
| Param | Type | Description |
|---|---|---|
| tracking_numberrequired | string | FedEx tracking number (typically 12-15 digits) |
{
"type": "object",
"fields": {
"output": "object containing packages array with tracking details including status, addresses, scan events, and delivery information",
"transactionId": "unique transaction identifier string"
},
"sample": {
"data": {
"output": {
"packages": [
{
"notFound": true,
"delivered": false,
"errorList": [
{
"code": "TRACKING.TRACKINGNUMBER.NOTFOUND",
"message": "The tracking number you entered can't be found right now."
}
],
"inTransit": true,
"keyStatus": "On the way",
"trackingNbr": "774212513411",
"statusWithDetails": "On the way"
}
],
"passedLoggedInCheck": false,
"passedGuestAuthCheck": false
},
"transactionId": "a8ee2d0a-a38b-4a17-ae95-7620ea15e5f6"
},
"status": "success"
}
}About the FedEx API
Shipment Tracking
The track_by_tracking_number endpoint accepts a tracking number (typically 12–15 digits) and returns a packages array containing the current status, origin and destination addresses, estimated delivery date, and a chronological list of scan events. Each scan event includes location, timestamp, and event description. The endpoint always returns a response — invalid or expired tracking numbers come back with a "not found" status rather than an error, so your application can handle both cases uniformly via the same response shape.
Country and Shipping Capability Data
get_countries requires no input and returns an array of all FedEx-supported countries and territories. Each entry includes countryCode, countryName, regionCode, currencyCode, and flags for domestic shipping availability and postal awareness. For deeper per-country detail, get_country_details takes a 2-letter ISO country_code and returns the full list of states or provinces, allowedShipDates, customs value limits, accepted credit card options, system of measure, and per-carrier postal awareness data. These two endpoints together let you prevalidate shipping eligibility before a user submits an order.
Address and Location Utilities
validate_address checks whether a given postal_code and optional country_code combination is recognized by FedEx. find_locations takes the same inputs and returns FedEx service locations near the specified postal code. Both return an output object and a transactionId you can use to correlate requests in your logs.
The FedEx API is a managed, monitored endpoint for fedex.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when fedex.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official fedex.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display real-time package status and scan history in an order management dashboard using
track_by_tracking_number - Validate customer-entered postal codes at checkout with
validate_addressbefore accepting a shipping address - Build a store locator feature that shows nearby FedEx drop-off points via
find_locations - Pre-screen destination countries for customs value limits and allowed ship dates using
get_country_details - Populate a country selector with FedEx-supported territories, region codes, and currency codes from
get_countries - Determine whether domestic FedEx shipping is available for a given country before surfacing shipping options
- Alert customers when a shipment scan event indicates an exception or delivery delay
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does FedEx have an official developer API?+
What does the tracking response include beyond the current status?+
track_by_tracking_number response includes the full scan event history (each event has a timestamp, location, and description), origin and destination addresses, estimated delivery date, and delivery status flags such as whether the package has been delivered or is in an exception state. It does not return raw weight, dimensions, or service-level pricing.Does `get_country_details` cover every field for all 200+ countries equally?+
states, allowedShipDates, and creditCardOptions are populated where FedEx exposes them, but some smaller territories return partial data. If a field is absent for a given country, it will be missing or null in the response rather than causing an error.Does the API support rate or pricing quotes for a shipment?+
Can I look up multiple tracking numbers in a single request?+
track_by_tracking_number accepts a single tracking number per call. You can fork this API on Parse and revise it to add a batch-tracking endpoint that accepts an array of tracking numbers.