{
  "openapi": "3.0.1",
  "info": {
    "title": "Nominatim Address Geocoder",
    "description": "Batch geocode addresses to GPS coordinates (forward geocoding) or convert latitude/longitude coordinates back to street addresses (reverse geocoding) using the OpenStreetMap Nominatim API. Powered by the world's largest open geographic database with global coverage across 200+ countries.",
    "version": "2.6",
    "x-build-id": "ZIWba3I8B4pWDL5E8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~nominatim-geocoder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-nominatim-geocoder",
        "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/ryanclinton~nominatim-geocoder/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-nominatim-geocoder",
        "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/ryanclinton~nominatim-geocoder/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-nominatim-geocoder",
        "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": "Geocoding Mode",
            "enum": [
              "forward",
              "reverse"
            ],
            "type": "string",
            "description": "Forward: address to coordinates. Reverse: coordinates to address.",
            "default": "forward"
          },
          "workflow": {
            "title": "Workflow",
            "enum": [
              "standard",
              "crm-cleanse",
              "validate",
              "enrich",
              "deduplicate",
              "delivery-validation",
              "lead-routing",
              "steward",
              "audit",
              "delivery"
            ],
            "type": "string",
            "description": "Job-named preset for your use case (composes with Mode). 'crm-cleanse' = repair dirty CRM addresses; 'lead-routing' = assign sales territory + owner; 'delivery-validation' = logistics serviceability; 'audit' = grade dataset quality; 'validate' = check addresses; 'enrich' = full location intelligence; 'deduplicate' = find duplicate places. Tunes the default output detail; the full decision layer is always computed.",
            "default": "standard"
          },
          "queries": {
            "title": "Addresses to Geocode",
            "maxItems": 10000,
            "type": "array",
            "description": "List of addresses to geocode (used in forward mode).",
            "items": {
              "type": "string"
            }
          },
          "latitudes": {
            "title": "Latitudes",
            "maxItems": 10000,
            "type": "array",
            "description": "List of latitudes for reverse geocoding. Must match longitudes list length.",
            "items": {
              "type": "string"
            }
          },
          "longitudes": {
            "title": "Longitudes",
            "maxItems": 10000,
            "type": "array",
            "description": "List of longitudes for reverse geocoding. Must match latitudes list length.",
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Country Code",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Restrict results to a country (ISO 3166-1 alpha-2 code, e.g. 'US', 'GB', 'DE'). Forward mode only."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Preferred language for results (e.g. 'en', 'de', 'fr').",
            "default": "en"
          },
          "maxAlternatives": {
            "title": "Alternative candidates",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Forward mode only. When greater than 0, also return up to N alternative candidate matches per address in an 'alternatives' array, so you can disambiguate when the top match might be wrong. 0 returns only the single best match.",
            "default": 0
          },
          "minConfidence": {
            "title": "Minimum confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Quality gate (0-100). Matches scoring below this confidence still appear in the dataset flagged as suppressed, but are not charged. 0 keeps and charges every match.",
            "default": 0
          },
          "outputProfile": {
            "title": "Output detail",
            "enum": [
              "minimal",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "How many fields each result carries. 'minimal' = query, coordinates, precision, confidence and recommended action only. 'standard' = full address breakdown plus the decision layer. 'full' = everything including OpenStreetMap internals, bounding box, decision trail and next-actor suggestions.",
            "default": "standard"
          },
          "structuredAddresses": {
            "title": "Structured addresses",
            "type": "array",
            "description": "Forward mode: provide addresses as structured objects ({ houseNumber, street, city, county, state, postcode, country }) for higher-precision matching than free text. When set, this overrides the Addresses field. Ideal for CRM / Salesforce / HubSpot exports."
          },
          "expectedCountry": {
            "title": "Expected country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code. When set, every result gets a countryMatched flag verifying it resolved to this country."
          },
          "allowedCountries": {
            "title": "Allowed countries",
            "type": "array",
            "description": "Boundary validation: ISO 3166-1 alpha-2 codes a result must fall within. Results outside get boundaryViolation=true.",
            "items": {
              "type": "string"
            }
          },
          "allowedStates": {
            "title": "Allowed states/regions",
            "type": "array",
            "description": "Boundary validation: state or region names a result must fall within (case-insensitive, e.g. 'England', 'California').",
            "items": {
              "type": "string"
            }
          },
          "referenceLat": {
            "title": "Reference latitude",
            "type": "number",
            "description": "When set with reference longitude, every result reports its distance and bearing from this point."
          },
          "referenceLon": {
            "title": "Reference longitude",
            "type": "number",
            "description": "When set with reference latitude, every result reports its distance and bearing from this point."
          },
          "maxRadiusKm": {
            "title": "Max radius (km)",
            "minimum": 0,
            "type": "number",
            "description": "When set with a reference point, results within this many km are flagged insideRadius=true."
          },
          "geofences": {
            "title": "Geofences",
            "type": "array",
            "description": "Circular or polygon geofences. Each result reports which it falls inside. Circle: { \"name\": \"Depot\", \"lat\": 51.5, \"lon\": -0.1, \"radiusKm\": 25 }. Polygon: { \"name\": \"Zone A\", \"polygon\": [[lat,lon],[lat,lon],[lat,lon]] }. Useful for delivery zones and territory routing."
          },
          "salesTerritories": {
            "title": "Sales territories",
            "type": "array",
            "description": "Named territories; each result is assigned the first match (the territory field) and its optional owner (recommendedOwner). Define geographically — { \"name\": \"North East\", \"owner\": \"jane@co\", \"polygon\": [[lat,lon],…] } or { \"name\": \"London\", \"lat\": 51.5, \"lon\": -0.1, \"radiusKm\": 40 } — or administratively — { \"name\": \"UK Enterprise\", \"countries\": [\"GB\"], \"states\": [\"England\"] }. Revenue teams use this for territory assignment and lead routing."
          },
          "cacheName": {
            "title": "Cache name",
            "type": "string",
            "description": "Opt-in cross-run cache. When set, repeated addresses are served instantly from a named store instead of re-calling Nominatim, and are not charged. Leave blank to disable caching."
          },
          "cacheMaxAgeDays": {
            "title": "Cache max age (days)",
            "minimum": 0,
            "type": "integer",
            "description": "How long a cached result stays valid before being re-fetched.",
            "default": 30
          },
          "inputDatasetId": {
            "title": "Input dataset ID",
            "type": "string",
            "description": "Read forward-mode addresses from another Apify dataset (e.g. a previous actor's output) instead of, or in addition to, the Addresses field."
          },
          "addressField": {
            "title": "Address field name",
            "type": "string",
            "description": "The field name to read the address from when an input dataset ID is set.",
            "default": "address"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}