# GeoNames Global Places & Cities Database Exporter (`logiover/geonames-global-places-scraper`) Actor

Export cities, towns and geographic features from GeoNames bulk dumps. Access millions of places with coordinates, population, timezone and admin codes by country. Keyless, daily-updated geodata.

- **URL**: https://apify.com/logiover/geonames-global-places-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Travel, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## GeoNames Global Places & Cities Database Exporter

Turn the official GeoNames bulk dumps into filtered, structured Apify datasets. Export cities, towns, administrative areas, airports, mountains, lakes and millions of other geographic features with coordinates, population, timezone and hierarchy codes—without a GeoNames username or API key.

### Built for

- GIS and location-intelligence products
- Logistics, routing and service-area datasets
- Travel, hospitality and local marketplace apps
- Offline geocoding and autocomplete indexes
- Localization, analytics and AI/RAG training corpora

GeoNames updates its dump directory daily. The Actor streams both global and per-country ZIPs and can store up to **500,000 matching places per run**.

### Input

| Field | Description | Default |
|---|---|---|
| `dataset` | `cities500`, `cities1000`, `cities5000`, `cities15000`, `allCountries`, or `countryFiles` | `cities500` |
| `countryCodes` | ISO alpha-2 filters; files to download in `countryFiles` mode | all / US |
| `query` | Search primary, ASCII and alternate names | empty |
| `featureClasses` | GeoNames classes such as `P`, `A`, `S` | all |
| `featureCodes` | Exact codes such as `PPLC`, `PPLA`, `AIRP` | all |
| `minPopulation` | Minimum population | `0` |
| `maxResults` | Maximum places, 1–500,000 | `1000` |

Example — populated places in Turkey with 10,000+ population:

```json
{
  "dataset": "countryFiles",
  "countryCodes": ["TR"],
  "featureClasses": ["P"],
  "minPopulation": 10000,
  "maxResults": 100000
}
```

Example — worldwide capital cities:

```json
{
  "dataset": "allCountries",
  "featureCodes": ["PPLC"],
  "maxResults": 10000
}
```

### Output

Every item follows the documented 19-column GeoNames format and adds source, license and place links. Fields include `geonameId`, names, WGS84 latitude/longitude, feature class/code, country/admin codes, population, elevation, DEM, timezone and modification date.

```json
{
  "geonameId": "745044",
  "name": "Istanbul",
  "asciiName": "Istanbul",
  "latitude": 41.01384,
  "longitude": 28.94966,
  "featureClass": "P",
  "featureCode": "PPLA",
  "countryCode": "TR",
  "population": 14804116,
  "timezone": "Europe/Istanbul"
}
```

### API usage

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~geonames-global-places-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dataset":"countryFiles","countryCodes":["DE"],"featureClasses":["P"],"maxResults":50000}'
```

### License and source

Data comes from the [GeoNames download server](https://download.geonames.org/export/dump/) and is licensed under CC BY 4.0. GeoNames attribution must be retained. Coordinates are WGS84; coverage, names and population figures can vary by country and source contributor.

### Changelog

- **2026-08-01 — v1.0.0:** Initial release. Added five global city/all-feature datasets and country files, name/geography/feature/population filters, daily source links, CC BY attribution, 500,000-item scale and live default/filtered validation.

# Actor input Schema

## `dataset` (type: `string`):

Choose a global city threshold, the complete world dump, or selected country files.

## `countryCodes` (type: `array`):

Optional ISO alpha-2 codes. Required for countryFiles; defaults to US there.

## `query` (type: `string`):

Optional case-insensitive search across primary, ASCII and alternate names.

## `featureClasses` (type: `array`):

Optional GeoNames classes: P populated place, A administrative, H water, L area, R road, S spot/building, T terrain, U undersea, V vegetation.

## `featureCodes` (type: `array`):

Optional exact GeoNames feature codes such as PPLC, PPLA or AIRP.

## `minPopulation` (type: `integer`):

Only return places at or above this population.

## `maxResults` (type: `integer`):

Maximum matching places to save; supports bulk exports up to 500,000 items per run.

## Actor input object example

```json
{
  "dataset": "cities500",
  "countryCodes": [],
  "query": "",
  "featureClasses": [],
  "featureCodes": [],
  "minPopulation": 0,
  "maxResults": 1000
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/geonames-global-places-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("logiover/geonames-global-places-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call logiover/geonames-global-places-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,logiover/geonames-global-places-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2TyC8gVs9b2Ofg0s1/builds/JfkiIphQ1JqIjRSsE/openapi.json
