# IP Geolocation Scraper (`parseforge/ipapi-geolocation-scraper`) Actor

Bulk geolocation lookup for IPv4 and IPv6 addresses. Returns city, region, country, postal, latitude, longitude, timezone, ASN, organization, currency, languages, and country calling code per IP.

- **URL**: https://apify.com/parseforge/ipapi-geolocation-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 🌐 IP Geolocation Scraper

> 🚀 **Bulk-geolocate IPv4 and IPv6 addresses in seconds.** Pull **26 fields per IP** including city, country, lat/lng, timezone, ASN, organization, currency, and calling code. Pass a list of IPs, get a clean dataset. No login, no per-IP curl scripts.

> 🕒 **Last updated:** 2026-05-22 · **📊 26 fields** per record · **🌍 250+ countries** · **🔢 IPv4 + IPv6** · **🧭 ip-api feed with automatic fallback**

The **IP Geolocation Scraper** turns a list of IPv4 or IPv6 addresses into a clean dataset and returns **26 fields per record**, including city, region and region code, country name with ISO 2 and ISO 3 codes, capital, country TLD, continent, EU membership flag, postal code, latitude and longitude, timezone with UTC offset, calling code, currency, currency name, languages, country area and population, ASN, and the registered organization. The underlying source is the ip-api lookup feed with automatic freeipapi fallback for resilience.

The dataset spans **every country and territory with assigned IP allocations**, both IPv4 and IPv6, and surfaces both geographic and network-layer attributes in one record. This Actor turns a list of IPs into a downloadable dataset as CSV, Excel, JSON, or XML in under five minutes.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Security operations, fraud-detection teams, product analytics, IT operations, compliance, marketing localization | Threat enrichment, account-takeover scoring, region-aware feature gating, log enrichment, GDPR routing, CDN performance analysis |

---

### 📋 What the IP Geolocation Scraper does

A single bulk-lookup workflow with two main inputs:

- 📝 **IP list.** Pass IPv4 or IPv6 addresses in any quantity.
- 🎯 **Field projection.** Optional. Pick which of the 26 fields each record should carry.

Each record bundles network layer (IP, version, ASN, organization), geography (city, region, country, postal, lat/lng, continent, EU membership), timekeeping (timezone, UTC offset), and country reference data (capital, TLD, currency, languages, area, population, calling code).

> 💡 **Why it matters:** every security event log, signup form, and ad-bid request needs to know where an IP comes from. Building a private geolocation service means licensing MaxMind, hand-rolling fallbacks, and updating database files weekly. This Actor returns enriched records in a single run.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>ips</code></td><td>array</td><td><code>["8.8.8.8", "1.1.1.1", "208.67.222.222", "9.9.9.9", "4.2.2.1"]</code></td><td>IPv4 or IPv6 addresses to geolocate.</td></tr>
<tr><td><code>fields</code></td><td>array</td><td><code>[]</code></td><td>Optional projection of the 26 source fields. Empty returns the full record.</td></tr>
</tbody>
</table>

**Example: geolocate five public DNS resolvers.**

```json
{
    "maxItems": 5,
    "ips": ["8.8.8.8", "1.1.1.1", "208.67.222.222", "9.9.9.9", "4.2.2.1"]
}
````

**Example: minimal record with only city and country.**

```json
{
    "maxItems": 100,
    "ips": ["8.8.8.8", "1.1.1.1"],
    "fields": ["ip", "city", "country_name", "country_code"]
}
```

> ⚠️ **Good to Know:** IP geolocation is approximate. City-level results are typically accurate to within a metro area for residential IPs and to a country for mobile or carrier-grade NAT. For high-stakes fraud decisions, combine with device fingerprinting and behavioral signals. Reserved, private, and bogon IPs return diagnostic records.

***

### 📊 Output

Each record contains **26 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🌐 `ip` | string | `"8.8.8.8"` |
| 🔢 `version` | string | `"IPv4"` |
| 🏙️ `city` | string | `"Mountain View"` |
| 🗺️ `region` | string | `"California"` |
| 🆔 `regionCode` | string | `"CA"` |
| 🏳️ `countryName` | string | `"United States"` |
| 🆔 `countryCode` | string | `"US"` |
| 🆔 `countryCodeIso3` | string | `"USA"` |
| 🏛️ `countryCapital` | string | `"Washington"` |
| 🌐 `countryTld` | string | `".us"` |
| 🌎 `continentCode` | string | `"NA"` |
| 🇪🇺 `inEu` | boolean | `false` |
| 📮 `postal` | string | `"94043"` |
| 📍 `latitude` | number | `37.4056` |
| 📍 `longitude` | number | `-122.0775` |
| 🕒 `timezone` | string | `"America/Los_Angeles"` |
| ⏱️ `utcOffset` | string | `"-0700"` |
| ☎️ `countryCallingCode` | string | `"+1"` |
| 💱 `currency` | string | `"USD"` |
| 💱 `currencyName` | string | `"Dollar"` |
| 🗣️ `languages` | string | `"en-US,es-US,haw,fr"` |
| 📐 `countryArea` | number | `9629091` |
| 👥 `countryPopulation` | number | `331002651` |
| 🔢 `asn` | string | `"AS15169"` |
| 🏢 `org` | string | `"GOOGLE"` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-22T00:00:00.000Z"` |
| ⚠️ `error` | string | null | `null` |

#### 📦 Sample records

<details>
<summary><strong>🇺🇸 Public DNS: Google (8.8.8.8)</strong></summary>

```json
{
    "ip": "8.8.8.8",
    "version": "IPv4",
    "city": "Mountain View",
    "region": "California",
    "regionCode": "CA",
    "countryName": "United States",
    "countryCode": "US",
    "countryCodeIso3": "USA",
    "countryCapital": "Washington",
    "countryTld": ".us",
    "continentCode": "NA",
    "inEu": false,
    "postal": "94043",
    "latitude": 37.4056,
    "longitude": -122.0775,
    "timezone": "America/Los_Angeles",
    "utcOffset": "-0700",
    "countryCallingCode": "+1",
    "currency": "USD",
    "currencyName": "Dollar",
    "languages": "en-US,es-US,haw,fr",
    "countryArea": 9629091,
    "countryPopulation": 331002651,
    "asn": "AS15169",
    "org": "GOOGLE",
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🇦🇺 Public DNS: Cloudflare (1.1.1.1)</strong></summary>

```json
{
    "ip": "1.1.1.1",
    "version": "IPv4",
    "city": "South Brisbane",
    "region": "Queensland",
    "regionCode": "QLD",
    "countryName": "Australia",
    "countryCode": "AU",
    "countryCodeIso3": "AUS",
    "countryCapital": "Canberra",
    "countryTld": ".au",
    "continentCode": "OC",
    "inEu": false,
    "postal": "4101",
    "latitude": -27.4748,
    "longitude": 153.017,
    "timezone": "Australia/Brisbane",
    "utcOffset": "+1000",
    "countryCallingCode": "+61",
    "currency": "AUD",
    "currencyName": "Dollar",
    "languages": "en-AU",
    "countryArea": 7686850,
    "countryPopulation": 25499884,
    "asn": "AS13335",
    "org": "CLOUDFLARENET",
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🇨🇭 Public DNS: Quad9 (9.9.9.9)</strong></summary>

```json
{
    "ip": "9.9.9.9",
    "version": "IPv4",
    "city": "Zurich",
    "region": "Zurich",
    "regionCode": "ZH",
    "countryName": "Switzerland",
    "countryCode": "CH",
    "countryCodeIso3": "CHE",
    "countryCapital": "Bern",
    "countryTld": ".ch",
    "continentCode": "EU",
    "inEu": false,
    "postal": "8001",
    "latitude": 47.3667,
    "longitude": 8.55,
    "timezone": "Europe/Zurich",
    "utcOffset": "+0200",
    "countryCallingCode": "+41",
    "currency": "CHF",
    "currencyName": "Franc",
    "languages": "de-CH,fr-CH,it,rm",
    "countryArea": 41277,
    "countryPopulation": 8654622,
    "asn": "AS19281",
    "org": "QUAD9-AS",
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🌐 | **IPv4 and IPv6 ready.** One bulk lookup for both address families. |
| 🔢 | **Network-layer fields.** ASN and registered organization included on every record, not just geography. |
| 🌍 | **Country reference bundled.** Capital, TLD, currency, languages, area, and population shipped with every IP. |
| 🛡️ | **Automatic fallback.** Primary feed is ip-api, with freeipapi as backup if the primary trips a transient limit. |
| 🎯 | **Field projection.** Trim each record to just the columns your dashboard needs. |
| ⚡ | **Bulk friendly.** Pass hundreds or thousands of IPs in one input array. |
| 🚫 | **No authentication.** Public geolocation feeds. No API key, no token. |

> 📊 IP geolocation is the foundation of fraud scoring, region-aware product flows, and infrastructure analytics. Doing it well at scale is harder than it looks.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Fallback | Setup |
|---|---|---|---|---|---|
| **⭐ IP Geolocation Scraper** *(this Actor)* | $5 free credit, then pay-per-use | IPv4 + IPv6 worldwide | **Live per run** | freeipapi fallback built in | ⚡ 2 min |
| MaxMind GeoIP2 database | $50+/month | Excellent | Weekly file pull | None | ⏳ Hours |
| Per-IP curl scripts | Free | Whatever the feed offers | Live | None | 🕒 Days |
| Commercial geolocation feeds | $500+/month | Global, high accuracy | Real-time | Vendor SLA | ⏳ Hours |

Pick this Actor when you want bulk lookups, network-layer attributes, and zero database maintenance.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the IP Geolocation Scraper page on the Apify Store.
3. 🎯 **Set input.** Paste a list of IPs into the `ips` array and set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your dataset.
5. 📥 **Download.** Grab results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🛡️ Security & Fraud

- Enrich SIEM events with geo and ASN context
- Score account-takeover risk by country mismatch
- Flag VPN, hosting, and Tor exit nodes via ASN lookup
- Build allow/deny rules by region for sensitive endpoints

</td>
<td width="50%" valign="top">

#### 📊 Product Analytics

- Region-split funnel metrics by IP
- Localize pricing by detected country and currency
- Power A/B test geo-segments with verified data
- Build country-of-origin charts for executive dashboards

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 🖥️ IT Operations

- Map customer support tickets to data centers
- Audit firewall logs with ASN and org context
- Reverse-lookup outbound IPs in deploy scripts
- Track CDN edge usage with city-level granularity

</td>
<td width="50%" valign="top">

#### ⚖️ Compliance & Privacy

- GDPR routing based on EU-resident flag
- Geo-block subscribers per regulator request
- Document data-residency decisions with citations
- Audit cross-border data flows in security reviews

</td>
</tr>
</table>

***

### 🔌 Automating IP Geolocation Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Daily enrichment jobs against a watched IP list keep your downstream tables fresh without manual work.

***

### 🌟 Beyond business use cases

IP data powers more than commercial workflows. The same records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Network measurement studies and ASN analyses
- Coursework on Internet topology and routing
- Reproducible measurement studies with cited dataset pulls
- Open-data exercises on global infrastructure

</td>
<td width="50%">

#### 🎨 Personal and creative

- Visualize visitors on a personal blog dashboard
- Hobby projects on home-network logging
- Side projects on global Internet weather maps
- Curated lists of public DNS resolvers and their locations

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Public-interest tooling on Internet shutdown tracking
- Civic transparency around content blocking by region
- Investigative journalism on disinformation infrastructure
- Open-knowledge contributions to network research

</td>
<td width="50%">

#### 🧪 Experimentation

- Train geo-aware recommender systems
- Validate localization hypotheses with real IPs
- Prototype agent pipelines that enrich logs
- Seed analytics warehouses with realistic geo features

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20IP%20Geolocation%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20IP%20Geolocation%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20IP%20Geolocation%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20IP%20Geolocation%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pass a list of IPv4 or IPv6 addresses, click Start, and the Actor returns one structured record per IP. Each record carries city, country, ASN, organization, and country reference fields like currency and calling code.

#### 📏 How accurate is the geolocation?

City-level results are typically accurate to within a metro area for residential and corporate IPs. Mobile and carrier-grade NAT IPs may resolve only to country level. For high-stakes fraud or compliance decisions, combine with device fingerprinting and behavioral signals.

#### 🛡️ What happens if the primary feed rate-limits a request?

The Actor automatically falls back to a secondary geolocation feed (freeipapi) so your dataset stays complete. If both feeds fail for a given IP, that record carries an explicit error message.

#### 🔢 Does it support IPv6?

Yes. Both IPv4 and IPv6 addresses are supported in the same input array. The `version` field on each record tells you which family was looked up.

#### 🚫 What about private or reserved IPs?

Reserved, private, and bogon ranges return diagnostic records rather than fake geo data. Filter them out before enriching public logs.

#### ☎️ Why include calling code, currency, and languages?

Because most teams that enrich an IP also want to localize the experience. Bundling country reference fields means one Actor instead of two, and clean joins for region-aware UX.

#### 💼 Can I use this data commercially?

Yes. The underlying feeds permit commercial use within their terms. Review the source feed terms for your specific use case, especially for high-volume real-time scoring.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small pulls (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🔁 How often does the geolocation database update?

The upstream feeds update continuously as ASN assignments and BGP advertisements change. Every run of this Actor reads the live feed so your results reflect the current state of the routing table.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

IP Geolocation Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe geolocation records into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh geo enrichment into your SIEM, or alert your fraud team in Slack when a watched IP changes country.

***

### 🔗 Recommended Actors

- [**🌍 REST Countries Info Scraper**](https://apify.com/parseforge/restcountries-info-scraper) - 250+ countries with population, currencies, languages
- [**🐙 GitHub Status History Scraper**](https://apify.com/parseforge/github-status-history-scraper) - GitHub uptime, incidents, and component history
- [**🗺️ Nominatim OSM Scraper**](https://apify.com/parseforge/nominatim-osm-scraper) - Geocode addresses via OpenStreetMap
- [**✈️ OurAirports Scraper**](https://apify.com/parseforge/ourairports-scraper) - 85,000+ airports, heliports, and airfields worldwide
- [**📚 Internet Archive Search Scraper**](https://apify.com/parseforge/internet-archive-search-scraper) - 50M+ archived texts, audio, video, software

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more developer-tools scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by ip-api, freeipapi, or any of their contributors. All trademarks mentioned are the property of their respective owners. Only publicly available geolocation data is collected.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `ips` (type: `array`):

List of IPv4 or IPv6 addresses to geolocate (e.g. \["8.8.8.8","1.1.1.1"]).

## `fields` (type: `array`):

Optional. Only include the selected fields. Leave empty to return the full record.

## Actor input object example

```json
{
  "maxItems": 10,
  "ips": [
    "8.8.8.8",
    "1.1.1.1",
    "208.67.222.222",
    "9.9.9.9",
    "4.2.2.1"
  ]
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10,
    "ips": [
        "8.8.8.8",
        "1.1.1.1",
        "208.67.222.222",
        "9.9.9.9",
        "4.2.2.1"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/ipapi-geolocation-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "maxItems": 10,
    "ips": [
        "8.8.8.8",
        "1.1.1.1",
        "208.67.222.222",
        "9.9.9.9",
        "4.2.2.1",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/ipapi-geolocation-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "ips": [
    "8.8.8.8",
    "1.1.1.1",
    "208.67.222.222",
    "9.9.9.9",
    "4.2.2.1"
  ]
}' |
apify call parseforge/ipapi-geolocation-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/ipapi-geolocation-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "IP Geolocation Scraper",
        "description": "Bulk geolocation lookup for IPv4 and IPv6 addresses. Returns city, region, country, postal, latitude, longitude, timezone, ASN, organization, currency, languages, and country calling code per IP.",
        "version": "1.0",
        "x-build-id": "ZxEKbUTEmBkDfAP32"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~ipapi-geolocation-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-ipapi-geolocation-scraper",
                "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/parseforge~ipapi-geolocation-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-ipapi-geolocation-scraper",
                "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/parseforge~ipapi-geolocation-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-ipapi-geolocation-scraper",
                "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": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "ips": {
                        "title": "IP Addresses",
                        "type": "array",
                        "description": "List of IPv4 or IPv6 addresses to geolocate (e.g. [\"8.8.8.8\",\"1.1.1.1\"]).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "fields": {
                        "title": "Fields Projection",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. Only include the selected fields. Leave empty to return the full record.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "ip",
                                "version",
                                "city",
                                "region",
                                "region_code",
                                "country",
                                "country_name",
                                "country_code",
                                "country_code_iso3",
                                "country_capital",
                                "country_tld",
                                "continent_code",
                                "in_eu",
                                "postal",
                                "latitude",
                                "longitude",
                                "timezone",
                                "utc_offset",
                                "country_calling_code",
                                "currency",
                                "currency_name",
                                "languages",
                                "country_area",
                                "country_population",
                                "asn",
                                "org"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
