{
  "openapi": "3.0.1",
  "info": {
    "title": "Package Tracking API: AfterShip Shipment Export",
    "description": "Export package and parcel tracking data from your AfterShip account across 1,100+ carriers: shipment status, checkpoints, delivery dates and ETAs, filtered by status, courier, country and date. Also courier lists, courier detection and AI delivery date estimates. Bring your own key.",
    "version": "0.1",
    "x-build-id": "wp3yP3eYlOsgz0lrf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~package-tracking-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-package-tracking-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~package-tracking-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-package-tracking-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~package-tracking-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-package-tracking-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "listTrackings",
              "getTracking",
              "listCouriers",
              "detectCourier",
              "predictDeliveryDate",
              "createTrackings"
            ],
            "type": "string",
            "description": "Get trackings exports the shipments already in your AfterShip account, filtered by status, courier, country, date and more, with every checkpoint. Get tracking by ID reads single trackings. Get couriers lists the carriers AfterShip supports or the ones active on your account. Detect courier finds the carrier of a tracking number. Estimated delivery date asks the AfterShip AI for a delivery date on a route. Create trackings is opt-in: it adds new tracking numbers to your account and uses your AfterShip shipment quota.",
            "default": "listTrackings"
          },
          "trackingNumbers": {
            "title": "Tracking numbers",
            "type": "array",
            "description": "Get trackings (optional filter, up to 50 per request, 1,000 per run), Detect courier and Create trackings. One tracking number per line, 4 to 100 characters.",
            "items": {
              "type": "string"
            }
          },
          "trackingIds": {
            "title": "Tracking IDs",
            "type": "array",
            "description": "Get tracking by ID only. One AfterShip tracking ID per line (the id field of a tracking row, not the tracking number).",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Status",
            "type": "array",
            "description": "Get trackings only. Keep only shipments whose current status is one of these. Empty means every status.",
            "items": {
              "type": "string",
              "enum": [
                "Pending",
                "InfoReceived",
                "InTransit",
                "OutForDelivery",
                "AttemptFail",
                "Delivered",
                "AvailableForPickup",
                "Exception",
                "Expired"
              ],
              "enumTitles": [
                "Pending",
                "Info received",
                "In transit",
                "Out for delivery",
                "Failed attempt",
                "Delivered",
                "Available for pickup",
                "Exception",
                "Expired"
              ]
            }
          },
          "slugs": {
            "title": "Courier slugs",
            "type": "array",
            "description": "Get trackings, Get couriers and Detect courier. AfterShip courier codes such as dhl, ups, usps or fedex, one per line. Filters the trackings and couriers returned; for Detect courier, limits detection to these couriers.",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Get trackings only. Searches tracking_number, title, order_id, customer name, email and phone, and custom fields."
          },
          "origins": {
            "title": "Origin countries",
            "type": "array",
            "description": "Get trackings only. Origin country or region codes in ISO 3166-1 alpha-3, such as CHN, USA or GBR.",
            "items": {
              "type": "string"
            }
          },
          "destinations": {
            "title": "Destination countries",
            "type": "array",
            "description": "Get trackings only. Destination country or region codes in ISO 3166-1 alpha-3, such as USA, DEU or AUS.",
            "items": {
              "type": "string"
            }
          },
          "courierDestinations": {
            "title": "Destination countries reported by the courier",
            "type": "array",
            "description": "Get trackings only. Destination country codes (ISO 3166-1 alpha-3) as the carrier reports them.",
            "items": {
              "type": "string"
            }
          },
          "createdAtMin": {
            "title": "Created after",
            "type": "string",
            "description": "Get trackings only. A date such as 2026-10-01, or a date and time such as 2026-10-01T08:00:00Z. AfterShip keeps trackings for 120 days."
          },
          "createdAtMax": {
            "title": "Created before",
            "type": "string",
            "description": "Get trackings only. A date (end of that day, UTC) or a date and time."
          },
          "updatedAtMin": {
            "title": "Updated after",
            "type": "string",
            "description": "Get trackings only. Useful for daily syncs: export only shipments that changed since a date or a date and time."
          },
          "updatedAtMax": {
            "title": "Updated before",
            "type": "string",
            "description": "Get trackings only. A date (end of that day, UTC) or a date and time."
          },
          "shipmentTags": {
            "title": "Shipment tags",
            "type": "array",
            "description": "Get trackings only. Your own shipment tags, one per line.",
            "items": {
              "type": "string"
            }
          },
          "orderIds": {
            "title": "Order IDs",
            "type": "array",
            "description": "Get trackings only. Order IDs from your store, one per line.",
            "items": {
              "type": "string"
            }
          },
          "returnToSender": {
            "title": "Returned to sender",
            "enum": [
              "any",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Get trackings only. Keep only shipments that are (or are not) being returned to the sender.",
            "default": "any"
          },
          "transitTime": {
            "title": "Transit time (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Get trackings only. Keep only shipments with exactly this many days in transit."
          },
          "lang": {
            "title": "Translate checkpoints to",
            "enum": [
              "en",
              "fr",
              "fr-CA",
              "ar",
              "bg",
              "ca",
              "hr",
              "cs",
              "da",
              "nl",
              "et",
              "tl",
              "fi",
              "de",
              "el",
              "he",
              "hi",
              "hu",
              "id",
              "it",
              "ja",
              "ko",
              "lv",
              "lt",
              "ms",
              "pl",
              "pt",
              "ro",
              "ru",
              "sr",
              "sk",
              "sl",
              "es",
              "sv",
              "th",
              "tr",
              "uk",
              "vi",
              "zh-Hans",
              "zh-Hant",
              "nb"
            ],
            "type": "string",
            "description": "Get tracking by ID only, optional. Translates checkpoint messages from the carrier language. Empty keeps the original language."
          },
          "activeOnly": {
            "title": "Only couriers active on my account",
            "type": "boolean",
            "description": "Get couriers only. On: the couriers you activated in AfterShip. Off: every courier AfterShip supports.",
            "default": false
          },
          "courierSlug": {
            "title": "Courier slug",
            "type": "string",
            "description": "Estimated delivery date (required) and Create trackings (optional, empty means AfterShip auto detects). One AfterShip courier code such as ups or fedex."
          },
          "confirmCreate": {
            "title": "Confirm: create trackings in my AfterShip account",
            "type": "boolean",
            "description": "Create trackings only. Must be on for that mode to run. Each new tracking number is added to your AfterShip account and counts against your AfterShip shipment quota.",
            "default": false
          },
          "originCountry": {
            "title": "Origin country",
            "type": "string",
            "description": "Estimated delivery date only. ISO 3166-1 alpha-3 code of the place the carrier picks up from, such as USA."
          },
          "originState": {
            "title": "Origin state",
            "type": "string",
            "description": "Estimated delivery date only. State or province of the origin, such as CA. Give this or the origin postal code."
          },
          "originPostalCode": {
            "title": "Origin postal code",
            "type": "string",
            "description": "Estimated delivery date only. Postal code of the origin. Give this or the origin state."
          },
          "destinationCountry": {
            "title": "Destination country",
            "type": "string",
            "description": "Estimated delivery date only. ISO 3166-1 alpha-3 code of the destination, such as USA."
          },
          "destinationState": {
            "title": "Destination state",
            "type": "string",
            "description": "Estimated delivery date only. State or province of the destination. Give this or destination postal codes."
          },
          "destinationPostalCodes": {
            "title": "Destination postal codes",
            "type": "array",
            "description": "Estimated delivery date only. One prediction per postal code (up to 100 per run).",
            "items": {
              "type": "string"
            }
          },
          "pickupTime": {
            "title": "Pickup time",
            "type": "string",
            "description": "Estimated delivery date only. Local pickup date and time at the origin, such as 2026-11-02 15:00:00."
          },
          "serviceTypeName": {
            "title": "Service type",
            "type": "string",
            "description": "Estimated delivery date only, optional. The AfterShip service type code of the carrier service, as listed in the AfterShip docs."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing for calls to AfterShip. The default AfterShip limit is 10 requests per second; throttled calls are retried after the reset time AfterShip sends.",
            "default": 300
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own AfterShip API key, from the AfterShip admin under Settings, API keys (organization.automizely.com/api-keys). Stored as a secret and sent only to AfterShip in the as-api-key header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}