{
  "openapi": "3.0.1",
  "info": {
    "title": "Normalize Countries, Postal Codes & Currencies - ISO Codes",
    "description": "Messy country names, postal codes and currencies to clean ISO codes. Country in any language to ISO 3166, postal codes validated and reformatted per country (lost leading zeros restored), currencies to ISO 4217. Offline, built for Google Maps and lead datasets.",
    "version": "1.0",
    "x-build-id": "VDHTTDnJSjoff7lHs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/that_red_bird~country-postal-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-that_red_bird-country-postal-normalizer",
        "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/that_red_bird~country-postal-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-that_red_bird-country-postal-normalizer",
        "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/that_red_bird~country-postal-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-that_red_bird-country-postal-normalizer",
        "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": {
          "datasets": {
            "title": "Dataset(s) to normalize",
            "type": "array",
            "description": "Pick the dataset of any Google Maps, lead or e-commerce scraper run. Use the picker rather than typing an ID: it gives this Actor permission to read your dataset. Leave empty to use the pasted rows below, or the built-in demo list."
          },
          "rows": {
            "title": "Rows (JSON)",
            "type": "array",
            "description": "Optional. Paste rows as JSON objects, e.g. {\"country\":\"Deutschland\",\"postalCode\":\"D-10115\",\"currency\":\"euros\"}. Plain strings are treated as a country. Other fields are kept in the output.",
            "default": []
          },
          "rowsCsv": {
            "title": "Rows (CSV or JSON text)",
            "type": "string",
            "description": "Optional. Paste a CSV (first row = column names) or a JSON array. Columns named country, postalCode (or zip, postcode) and currency are detected automatically.",
            "default": ""
          },
          "countryField": {
            "title": "Country field",
            "type": "string",
            "description": "Name of the column with the country. Leave empty to auto-detect (country, countryCode, countryName, country_code and similar).",
            "default": ""
          },
          "postalField": {
            "title": "Postal code field",
            "type": "string",
            "description": "Name of the column with the postal code. Leave empty to auto-detect (postalCode, postcode, zip, zipCode, plz and similar).",
            "default": ""
          },
          "currencyField": {
            "title": "Currency field",
            "type": "string",
            "description": "Name of the column with the currency (symbol, name or code). Leave empty to auto-detect (currency, currencyCode, priceCurrency and similar).",
            "default": ""
          },
          "addressField": {
            "title": "Address field (country fallback)",
            "type": "string",
            "description": "When a row has no usable country, the country is read from the end of this address column (for example '... 1000 Tunis, Tunisia'). Leave empty to auto-detect an address column.",
            "default": ""
          },
          "defaultCountry": {
            "title": "Default country",
            "type": "string",
            "description": "Country (name or ISO code) assumed for rows without any country information, for example US or Tunisia. Postal code rules and ambiguous currency symbols need a country. Leave empty to leave such rows without a country.",
            "default": ""
          },
          "lookupPlaces": {
            "title": "Look up place names",
            "type": "boolean",
            "description": "For valid postal codes, also add place name, region and coordinates using the free zippopotam.us service. It covers about 60 countries and makes one web request per distinct postal code, so large runs are slower. Off by default.",
            "default": false
          },
          "keepAllFields": {
            "title": "Keep all original fields",
            "type": "boolean",
            "description": "When on, every field of the input row is copied to the output next to the normalized columns. Turn off to output only the new columns.",
            "default": true
          },
          "maxRows": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Safety limit on the number of rows processed in one run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}