{
  "openapi": "3.0.1",
  "info": {
    "title": "ZIP & Postal Code Lookup: Distance, Radius, 120+ Countries",
    "description": "Look up ZIP and postal codes in 124 countries: city, state, county and coordinates. Distance between two codes, all codes within a radius, codes for a city, and the nearest code to a latitude/longitude. Bulk or instant API. Not-found rows are free.",
    "version": "1.0",
    "x-build-id": "FDepSUOwsq1VtU39i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blueberry_rainstorm~postal-code-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blueberry_rainstorm-postal-code-lookup",
        "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/blueberry_rainstorm~postal-code-lookup/runs": {
      "post": {
        "operationId": "runs-sync-blueberry_rainstorm-postal-code-lookup",
        "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/blueberry_rainstorm~postal-code-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-blueberry_rainstorm-postal-code-lookup",
        "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": {
          "postalCodes": {
            "title": "Postal codes to look up",
            "type": "array",
            "description": "One code per line. Put the 2-letter country first (\"US 90210\", \"GB SW1A 1AA\", \"DE 10115\") or set Default country below. Each row returns place name, state, county and coordinates.",
            "default": [
              "US 90210",
              "GB SW1A 1AA",
              "DE 10115",
              "CA M5V 3L9",
              "JP 100-0001"
            ],
            "items": {
              "type": "string"
            }
          },
          "distancePairs": {
            "title": "Distance between two codes",
            "type": "array",
            "description": "Two codes per line separated by \";\", e.g. \"US 10001; US 94105\" or \"GB SW1A 1AA; FR 75001\". Returns the straight-line distance in km and miles.",
            "items": {
              "type": "string"
            }
          },
          "radiusCenters": {
            "title": "Find codes within a radius of",
            "type": "array",
            "description": "Center codes, one per line, e.g. \"US 60601\". Each returns every code of the same country within the radius below, nearest first.",
            "items": {
              "type": "string"
            }
          },
          "radius": {
            "title": "Radius",
            "minimum": 0.1,
            "maximum": 2000,
            "type": "number",
            "description": "Search radius for the centers above.",
            "default": 10
          },
          "radiusUnit": {
            "title": "Radius unit",
            "enum": [
              "km",
              "mi"
            ],
            "type": "string",
            "description": "Kilometers or miles.",
            "default": "km"
          },
          "placeNames": {
            "title": "Codes for a city or place",
            "type": "array",
            "description": "\"City, state, country\" or \"City, country\", e.g. \"Springfield, IL, US\" or \"Lyon, FR\". Returns all postal codes of that place.",
            "items": {
              "type": "string"
            }
          },
          "coordinates": {
            "title": "Nearest code to coordinates",
            "type": "array",
            "description": "\"latitude, longitude\" per line, e.g. \"40.7484, -73.9857\". Returns the nearest postal code (any country) and its distance.",
            "items": {
              "type": "string"
            }
          },
          "defaultCountry": {
            "title": "Default country",
            "pattern": "^([A-Za-z]{2})?$",
            "type": "string",
            "description": "2-letter ISO code (US, GB, DE, FR, CA, ...) used when a line has no country.",
            "default": "US"
          },
          "maxResultsPerSearch": {
            "title": "Max codes per radius or place search",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Caps the list of codes in one radius or place row. The row still reports the full count.",
            "default": 500
          },
          "maxRequests": {
            "title": "Max requests",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many lines in total (all sections together).",
            "default": 100000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}