{
  "openapi": "3.0.1",
  "info": {
    "title": "Geocoding Scraper — Address ↔ Coordinates (OpenStreetMap)",
    "description": "Free geocoding for agents and CRMs via OpenStreetMap: address or place → lat/lon with full address breakdown, structured queries (street/city/postcode), reverse geocoding with zoom levels, OSM id lookup, bounded POI search, boundary polygons, multilingual names. Nominatim or Photon (fuzzy).",
    "version": "0.1",
    "x-build-id": "KRlE22a45t3zLMo1H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~osm-geocode/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-osm-geocode",
        "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/yadroo~osm-geocode/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-osm-geocode",
        "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/yadroo~osm-geocode/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-osm-geocode",
        "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": {
          "queries": {
            "title": "Addresses, places, lat,lon or OSM ids",
            "type": "array",
            "description": "Free-text address or place name → forward geocoding; `lat,lon` → reverse geocoding; OSM ids like `R62422` / `N123,W456` → lookup (Nominatim). One request per entry, 1 request/second (Nominatim policy).",
            "items": {
              "type": "string"
            }
          },
          "structuredQueries": {
            "title": "Structured queries (Nominatim)",
            "type": "array",
            "description": "Precise address parts instead of one string: objects with any of `amenity`, `street` (house number + street), `city`, `county`, `state`, `country`, `postalcode`, optional `label`. Better hit-rate for CRM addresses than free text."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "forward",
              "reverse",
              "lookup"
            ],
            "type": "string",
            "description": "Force one mode for all queries or let the actor detect it per entry.",
            "default": "auto"
          },
          "engine": {
            "title": "Engine",
            "enum": [
              "nominatim",
              "photon"
            ],
            "type": "string",
            "description": "Both are free OSM-based geocoders. Nominatim: exact matching, rich address breakdown, 1 req/s. Photon: fuzzy matching (good for messy user input), fewer address fields, languages en/de/fr only. Structured queries and OSM lookups always use Nominatim.",
            "default": "nominatim"
          },
          "lang": {
            "title": "Language of results",
            "type": "string",
            "description": "Accept-Language for names, e.g. `en`, `ru`, `kk`, `de`, or a list `ru,en`. Photon supports only en/de/fr (otherwise local names).",
            "default": "en"
          },
          "countryCodes": {
            "title": "Restrict to countries",
            "type": "string",
            "description": "Comma-separated ISO-3166 alpha-2 codes, e.g. `kz,ru`. Empty = worldwide."
          },
          "viewbox": {
            "title": "Bounding box (minLon,minLat,maxLon,maxLat)",
            "type": "string",
            "description": "Prefer results inside this box, e.g. Almaty: `76.75,43.15,77.10,43.40`. With `bounded` = true results outside are excluded (turns a search like `pharmacy` into an in-area POI search)."
          },
          "bounded": {
            "title": "Only inside the bounding box",
            "type": "boolean",
            "description": "Nominatim: exclude results outside `viewbox`.",
            "default": false
          },
          "featureType": {
            "title": "Feature type",
            "enum": [
              "",
              "country",
              "state",
              "city",
              "settlement"
            ],
            "type": "string",
            "description": "Nominatim: return only places of this administrative type.",
            "default": ""
          },
          "layers": {
            "title": "Layers",
            "type": "array",
            "description": "Nominatim: restrict to `address`, `poi`, `railway`, `natural`, `manmade`. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "address",
                "poi",
                "railway",
                "natural",
                "manmade"
              ],
              "enumTitles": [
                "Address (streets, buildings, places)",
                "POI (shops, amenities, offices)",
                "Railway",
                "Natural (rivers, peaks…)",
                "Man-made (bridges, towers…)"
              ]
            }
          },
          "limit": {
            "title": "Results per query",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Nominatim max 40, Photon max 50. `bestMatch` marks rank 1.",
            "default": 1
          },
          "reverseZoom": {
            "title": "Reverse geocoding detail (zoom)",
            "minimum": 0,
            "maximum": 18,
            "type": "integer",
            "description": "Nominatim reverse: 18 = building, 17 = street, 16 = major street, 14 = suburb, 12 = town/borough, 10 = city, 8 = county, 5 = state, 3 = country.",
            "default": 18
          },
          "addressDetails": {
            "title": "Address breakdown",
            "type": "boolean",
            "description": "Include the `address` object and derived `country`, `city`, `road`… columns.",
            "default": true
          },
          "extraTags": {
            "title": "Extra OSM tags",
            "type": "boolean",
            "description": "Nominatim: `extraTags` with wikidata, website, opening_hours, building:levels, population… when mapped.",
            "default": false
          },
          "nameDetails": {
            "title": "Names in all languages",
            "type": "boolean",
            "description": "Nominatim: `nameDetails` with `name:ru`, `name:kk`, `official_name`, `alt_name`…",
            "default": false
          },
          "polygon": {
            "title": "Boundary polygon (GeoJSON)",
            "type": "boolean",
            "description": "Nominatim: add the outline of the place as `geojson` (city/district boundaries, building footprints). Can be large — combine with `polygonThreshold`.",
            "default": false
          },
          "polygonThreshold": {
            "title": "Polygon simplification tolerance",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Degrees; 0.005 ≈ city-level simplification. 0 = full detail.",
            "default": 0
          },
          "dedupe": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Nominatim: merge the same street/place appearing as several OSM objects.",
            "default": true
          },
          "emitNotFound": {
            "title": "Emit a row for not-found queries",
            "type": "boolean",
            "description": "Writes a `found: false` row for each query with no match, keeping input/output aligned 1:1. Each such row is a dataset item and is charged like a hit, so it is off by default; not-found queries are always listed free in the SUMMARY record. Failed queries (errors) never produce rows.",
            "default": false
          },
          "outputFields": {
            "title": "Only these output fields",
            "type": "array",
            "description": "Optional projection, e.g. `[\"query\",\"lat\",\"lon\",\"displayName\",\"countryCode\"]`.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max rows per run",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on dataset rows.",
            "default": 10000
          },
          "osmTag": {
            "title": "Photon: OSM tag filter",
            "type": "string",
            "description": "Photon only. Filter/boost by tag: `amenity:cafe`, `tourism`, `!amenity:parking` (exclude), `shop:supermarket`."
          },
          "photonLayers": {
            "title": "Photon: layers",
            "type": "array",
            "description": "Photon only: restrict result granularity.",
            "items": {
              "type": "string",
              "enum": [
                "house",
                "street",
                "locality",
                "district",
                "city",
                "county",
                "state",
                "country",
                "other"
              ],
              "enumTitles": [
                "House / building",
                "Street",
                "Locality (neighbourhood, suburb)",
                "District",
                "City",
                "County",
                "State / region",
                "Country",
                "Other"
              ]
            }
          },
          "biasLat": {
            "title": "Photon: bias latitude",
            "type": "number",
            "description": "Photon only: prefer results near this point (with biasLon)."
          },
          "biasLon": {
            "title": "Photon: bias longitude",
            "type": "number",
            "description": "Photon only."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}