{
  "openapi": "3.0.1",
  "info": {
    "title": "Reverse Geocoding API Worldwide with Time Zones: OpenCage",
    "description": "Forward and reverse geocoding for any country through the OpenCage API on OpenStreetMap and open data: coordinates to address, address to latitude and longitude, plus time zone, currency, calling code, what3words, geohash, MGRS, FIPS and NUTS annotations. Results may be stored. Bring your own key.",
    "version": "0.1",
    "x-build-id": "bT01SHHSwNtLwwH1Z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~reverse-geocoding-worldwide-openstreetmap-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-reverse-geocoding-worldwide-openstreetmap-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~reverse-geocoding-worldwide-openstreetmap-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-reverse-geocoding-worldwide-openstreetmap-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~reverse-geocoding-worldwide-openstreetmap-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-reverse-geocoding-worldwide-openstreetmap-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 do",
            "enum": [
              "geocode",
              "reverse"
            ],
            "type": "string",
            "description": "Forward geocoding turns addresses and placenames into coordinates. Reverse geocoding turns latitude,longitude pairs into the nearest address. Both work for every country and return OpenCage annotations such as time zone and currency.",
            "default": "geocode"
          },
          "addresses": {
            "title": "Addresses or placenames",
            "type": "array",
            "description": "Forward mode. One address, placename or postcode per line, at least two characters, in the order the country writes it. OpenCage does not do fuzzy matching. A UN/LOCODE works with the prefix LOCODE:, such as LOCODE:DEBRV. Duplicates are sent once.",
            "items": {
              "type": "string"
            }
          },
          "coordinates": {
            "title": "Coordinates",
            "type": "array",
            "description": "Reverse mode. One latitude,longitude pair per line, latitude first, in decimal degrees with a period as the decimal separator. OpenCage returns at most one result per coordinate.",
            "items": {
              "type": "string"
            }
          },
          "countryCodes": {
            "title": "Country codes",
            "type": "array",
            "description": "Forward mode. Restricts results to these countries or territories, as two letter ISO 3166-1 codes such as de, gb or us (sent as countrycode). Territories with their own code, such as pr for Puerto Rico, need that code.",
            "items": {
              "type": "string"
            }
          },
          "bounds": {
            "title": "Bounding box",
            "type": "string",
            "description": "Forward mode. Restricts results to a box given as min longitude,min latitude,max longitude,max latitude, for example -0.563160,51.280430,0.278970,51.683979 for Greater London."
          },
          "proximity": {
            "title": "Proximity",
            "type": "string",
            "description": "Forward mode. A latitude,longitude point such as 52.5432379,13.4142133. Results closer to it rank higher; it is a hint, not a filter."
          },
          "limit": {
            "title": "Results per lookup",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Forward mode. The most matches OpenCage returns per address, from 1 to 100. The first result fills the row and the rest go in otherResults. Reverse geocoding always returns at most one.",
            "default": 1
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Optional. An IETF language code such as de, es or pt-BR, or native for the local language. OpenCage favours, but does not limit results to, this language. English when empty."
          },
          "annotations": {
            "title": "Include annotations",
            "type": "boolean",
            "description": "Adds OpenCage annotations to every match: time zone, currency, calling code, what3words, geohash, MGRS, Maidenhead, DMS, FIPS (US), NUTS (Europe), UN M49, Wikidata, OpenStreetMap links, road info and sun times. Switch off to send no_annotations=1 for slightly faster answers.",
            "default": true
          },
          "roadinfo": {
            "title": "Match the nearest road",
            "type": "boolean",
            "description": "Sends roadinfo=1: OpenCage matches the nearest road instead of an address and fills extra road details where known, such as speed limit, lanes, surface and toll.",
            "default": false
          },
          "addressOnly": {
            "title": "Address only",
            "type": "boolean",
            "description": "Sends address_only=1: the formatted address leaves out point of interest names, such as a shop or museum at the address.",
            "default": false
          },
          "abbreviate": {
            "title": "Abbreviate the formatted address",
            "type": "boolean",
            "description": "Sends abbrv=1: OpenCage shortens the formatted address, for example Massachusetts Ave instead of Massachusetts Avenue.",
            "default": false
          },
          "noDedupe": {
            "title": "Keep duplicate results",
            "type": "boolean",
            "description": "Sends no_dedupe=1 so OpenCage does not deduplicate the results of a lookup.",
            "default": false
          },
          "noRecord": {
            "title": "Do not log queries at OpenCage",
            "type": "boolean",
            "description": "Sends no_record=1 so OpenCage keeps no record of the query contents. Use it for addresses of people or other sensitive locations.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. One run takes up to 10,000 addresses or coordinates.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 6000,
            "type": "integer",
            "description": "Pacing for calls to OpenCage. Free trial keys are limited to one request per second (60 per minute); paid plans allow more. Throttled calls are retried after a pause.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own OpenCage geocoding API key, from your dashboard at opencagedata.com. Stored as a secret and sent only to OpenCage as the documented key parameter; 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}