{
  "openapi": "3.0.1",
  "info": {
    "title": "IP Geolocation API with Threat Intelligence: ipdata",
    "description": "IP geolocation and threat intelligence from the ipdata API: country, city, coordinates, ASN, company, mobile carrier, time zone, currency, VPN, proxy, Tor and datacenter flags, blocklists and IP reputation scores, plus bulk lookups and Advanced ASN profiles. Bring your own key.",
    "version": "0.1",
    "x-build-id": "Vh5et6leMYja3TI5W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~ip-geolocation-threat-intelligence-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-ip-geolocation-threat-intelligence-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-threat-intelligence-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-ip-geolocation-threat-intelligence-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-threat-intelligence-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-ip-geolocation-threat-intelligence-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 get",
            "enum": [
              "ipLookup",
              "bulkLookup",
              "threatLookup",
              "companyLookup",
              "asnLookup"
            ],
            "type": "string",
            "description": "IP lookup returns the full ipdata record per IP (location, ASN, company, carrier, time zone, currency and threat data). Bulk IP lookup sends up to 100 IPs per request and needs a paid plan. Threat intelligence and Company lookup call the single field routes. ASN lookup reads the Advanced ASN API (paid plans).",
            "default": "ipLookup"
          },
          "ips": {
            "title": "IP addresses",
            "type": "array",
            "description": "IP, bulk, threat and company modes. One public IPv4 or IPv6 address per line. Private and reserved addresses are refused by the API and never charged.",
            "items": {
              "type": "string"
            }
          },
          "asns": {
            "title": "ASNs",
            "type": "array",
            "description": "ASN lookup only. One AS number per line, such as AS15169 or 15169.",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "title": "Response fields",
            "type": "array",
            "description": "IP lookup only, optional. Only these fields come back (the IP is always included). Empty means every field your plan returns.",
            "items": {
              "type": "string",
              "enum": [
                "ip",
                "is_eu",
                "city",
                "region",
                "region_code",
                "country_name",
                "country_code",
                "continent_name",
                "continent_code",
                "latitude",
                "longitude",
                "asn",
                "company",
                "postal",
                "calling_code",
                "flag",
                "emoji_flag",
                "emoji_unicode",
                "carrier",
                "languages",
                "currency",
                "time_zone",
                "threat",
                "count"
              ],
              "enumTitles": [
                "IP address",
                "Is in the EU",
                "City",
                "Region",
                "Region code (ISO 3166-2)",
                "Country name",
                "Country code (ISO 3166-1 alpha-2)",
                "Continent name",
                "Continent code",
                "Latitude",
                "Longitude",
                "ASN (number, name, domain, route, usage type)",
                "Company (name, domain, network, type)",
                "Postal code",
                "Calling code",
                "Flag image URL",
                "Flag emoji",
                "Flag emoji Unicode",
                "Mobile carrier (name, MCC, MNC)",
                "Languages",
                "Currency",
                "Time zone",
                "Threat intelligence (Tor, VPN, proxy, blocklists, scores)",
                "Requests on this key in the last 24 hours"
              ]
            }
          },
          "endpoint": {
            "title": "Endpoint",
            "enum": [
              "global",
              "eu"
            ],
            "type": "string",
            "description": "The global endpoint api.ipdata.co, or the EU endpoint eu-api.ipdata.co, which keeps the IP addresses you send on EU servers (Frankfurt, Paris and Ireland).",
            "default": "global"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 1200,
            "type": "integer",
            "description": "Pacing for calls to ipdata. Throttled calls are retried after a pause. A bulk request of 100 IPs counts as one call here and as 100 requests against your ipdata quota.",
            "default": 300
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own ipdata API key, from the dashboard at dashboard.ipdata.co. Stored as a secret and sent only to ipdata in the api-key query 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}