{
  "openapi": "3.0.1",
  "info": {
    "title": "IP Geolocation API: VPN Check, Time Zone and Currency Rates",
    "description": "IP geolocation API for IPv4 and IPv6: country, city, coordinates, ASN, ISP, VPN, proxy and Tor detection, abuse contacts, time zones, sunrise and sunset, user agent parsing (ipgeolocation.io) plus live and historical exchange rates (CurrencyFreaks). Bring your own key.",
    "version": "0.1",
    "x-build-id": "s4NUNbbmNLmN5BGUq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~ip-geolocation-timezone-currency-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-ip-geolocation-timezone-currency-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~ip-geolocation-timezone-currency-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-ip-geolocation-timezone-currency-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~ip-geolocation-timezone-currency-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-ip-geolocation-timezone-currency-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 read",
            "enum": [
              "ipLookup",
              "ipSecurity",
              "asnLookup",
              "abuseContact",
              "timezone",
              "timeConvert",
              "astronomy",
              "userAgent",
              "fxLatest",
              "fxHistorical",
              "fxTimeSeries",
              "fxFluctuation",
              "fxConvert",
              "ipToCurrency",
              "currencies"
            ],
            "type": "string",
            "description": "Each mode calls one documented read endpoint. The first eight use the ipgeolocation.io API and your ipgeolocation.io key; the last seven use the CurrencyFreaks API and your CurrencyFreaks key. Plans named below are the providers' own.",
            "default": "ipLookup"
          },
          "apiKey": {
            "title": "ipgeolocation.io API key",
            "type": "string",
            "description": "Your own API key from app.ipgeolocation.io (a free plan with 1,000 credits a day exists). Used by the IP, time zone, astronomy and user agent modes. Leave empty to use the DATA_API_KEY secret."
          },
          "currencyApiKey": {
            "title": "CurrencyFreaks API key",
            "type": "string",
            "description": "Your own API key from currencyfreaks.com (a free plan with 1,000 calls a month exists). Used by the exchange rate modes. Leave empty to use the DATA_API_KEY_CURRENCY or DATA_API_KEY secret. Not needed for the supported currencies mode."
          },
          "ips": {
            "title": "IP addresses",
            "type": "array",
            "description": "IP geolocation, IP security, ASN, abuse contact and IP to currency. One IPv4 or IPv6 address per line. IP geolocation also takes domain names on paid plans. Each address is one request.",
            "items": {
              "type": "string"
            }
          },
          "asns": {
            "title": "AS numbers",
            "type": "array",
            "description": "ASN lookup. One AS number per line, such as AS15169 or 15169. Looked up directly, without an IP.",
            "items": {
              "type": "string"
            }
          },
          "include": {
            "title": "Extra IP geolocation modules",
            "type": "array",
            "description": "IP geolocation. Optional modules added to each answer (the include parameter). ipgeolocation.io paid plans only; a free key is refused.",
            "items": {
              "type": "string",
              "enum": [
                "geo_accuracy",
                "dma_code",
                "security",
                "abuse",
                "hostname",
                "liveHostname",
                "hostnameFallbackLive"
              ],
              "enumTitles": [
                "Accuracy radius and confidence",
                "US DMA code",
                "Security: VPN, proxy, Tor, threat score (+2 credits)",
                "Abuse contact (+1 credit)",
                "Hostname from the database",
                "Live hostname lookup",
                "Hostname, live lookup as fallback"
              ]
            }
          },
          "asnInclude": {
            "title": "Extra ASN data",
            "type": "array",
            "description": "ASN lookup. Optional lists added to each ASN record (the include parameter).",
            "items": {
              "type": "string",
              "enum": [
                "peers",
                "downstreams",
                "upstreams",
                "routes",
                "whois_response"
              ],
              "enumTitles": [
                "Peers",
                "Downstreams",
                "Upstreams",
                "Routes",
                "Raw WHOIS response"
              ]
            }
          },
          "fields": {
            "title": "Only these fields",
            "type": "string",
            "description": "IP geolocation, IP security, ASN and abuse contact. Comma separated fields or objects to return, with dot notation, such as location.city,asn.organization. Leave empty for the full answer. Works on every plan."
          },
          "excludes": {
            "title": "Leave out these fields",
            "type": "string",
            "description": "IP geolocation, IP security, ASN and abuse contact. Comma separated fields or objects to remove, such as currency,location.continent_code."
          },
          "lang": {
            "title": "Response language",
            "enum": [
              "en",
              "de",
              "ru",
              "ja",
              "fr",
              "cn",
              "es",
              "cs",
              "it",
              "ko",
              "fa",
              "pt",
              "ar"
            ],
            "type": "string",
            "description": "IP geolocation, and IP based time zone and astronomy lookups. Languages other than English need an ipgeolocation.io paid plan.",
            "default": "en"
          },
          "lookupBy": {
            "title": "Look places up by",
            "enum": [
              "timeZoneName",
              "location",
              "coordinates",
              "ip",
              "iata",
              "icao",
              "locode"
            ],
            "type": "string",
            "description": "Time zone and astronomy. How each line of Places is read. Astronomy takes an address, coordinates or an IP address, and reads a time zone name setting as an address.",
            "default": "timeZoneName"
          },
          "places": {
            "title": "Places",
            "type": "array",
            "description": "Time zone and astronomy. One place per line, in the form chosen above: Europe/London, London, UK, 51.5072,-0.1276, 8.8.8.8, LHR, EGLL or DEBER.",
            "items": {
              "type": "string"
            }
          },
          "dates": {
            "title": "Dates",
            "type": "array",
            "description": "Astronomy and historical exchange rates. One date per line as YYYY-MM-DD. Astronomy reads every place for every date (today when empty); historical rates read each date, from 1984-11-28.",
            "items": {
              "type": "string"
            }
          },
          "elevation": {
            "title": "Elevation (meters)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Astronomy. Height above sea level used to refine sunrise and sunset, from 0 to 10,000 meters."
          },
          "eventTimeZone": {
            "title": "Event time zone",
            "type": "string",
            "description": "Astronomy. An IANA time zone name, such as Europe/London, to express sunrise, sunset and the other event times in. Leave empty for the place's own time zone."
          },
          "timeConversions": {
            "title": "Time conversions",
            "type": "array",
            "description": "Time conversion. One conversion per line: source and target IANA time zone names and an optional time as YYYY-MM-DD HH:mm or YYYY-MM-DD HH:mm:ss. Without a time the current time is converted.",
            "items": {
              "type": "string"
            }
          },
          "userAgents": {
            "title": "User agent strings",
            "type": "array",
            "description": "User agent parsing. One full user agent string per line. Each string is one request.",
            "items": {
              "type": "string"
            }
          },
          "base": {
            "title": "Base currency",
            "type": "string",
            "description": "Exchange rate modes, and the currency converted from in IP to currency. A currency code such as USD, EUR or BTC. A base other than USD needs a CurrencyFreaks paid plan.",
            "default": "USD"
          },
          "symbols": {
            "title": "Currencies to return",
            "type": "array",
            "description": "Latest, historical, time series and fluctuation. Limit the answer to these codes (fiat, crypto such as BTC or metals such as XAU). Leave empty for every currency.",
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Historical rates, time series and fluctuation. First day of a range as YYYY-MM-DD. Historical rates read every day of the range (up to 1,000 days, one call each); time series and fluctuation read it in one call."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Historical rates, time series and fluctuation. Last day of the range as YYYY-MM-DD, inclusive. Defaults to today for historical rates and to yesterday for time series and fluctuation, as the API does."
          },
          "conversions": {
            "title": "Conversions",
            "type": "array",
            "description": "Currency conversion. One conversion per line as amount, from code and to code, such as 100 USD EUR. Add a date, such as 100 USD EUR 2024-01-31, to convert at that day's rate.",
            "items": {
              "type": "string"
            }
          },
          "amount": {
            "title": "Amount",
            "minimum": 0,
            "type": "number",
            "description": "IP to currency. The amount in the base currency to convert into each IP address's local currency.",
            "default": 1
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The run stops after this many rows.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}