# Forward Geocoder (`poidata/forward-geocoder`) Actor

Quickly convert place names, addresses, or landmarks into coordinates. Forward Geocoder delivers fast, accurate latitude and longitude data for any location. Run via API, export results, schedule tasks, and integrate seamlessly into your workflows.

- **URL**: https://apify.com/poidata/forward-geocoder.md
- **Developed by:** [PoiData](https://apify.com/poidata) (community)
- **Categories:** Developer tools, Automation, Real estate
- **Features:** Limited permissions
- **Stats:** 11 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.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.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Geocoder: Forward Geocoding API for Place Names & Addresses

Turn any **place name, landmark, or address** into precise **latitude and longitude** — one at a time or in bulk. Geocoder is a lightweight Apify Actor that works as a simple **forward geocoding API** for developers, data teams, and no-code automation.

> **Quick answer:** Give Geocoder a place (like "Eiffel Tower") or a list of places, and it returns clean coordinates you can use right away: `name`, `country_code`, `lat`, and `lng`.

***

### At a glance

| | |
|---|---|
| **What it does** | Forward geocoding (text → coordinates) |
| **Input** | A single `place`, or a list of `places` |
| **Output** | `query`, `name`, `country_code`, `lat`, `lng` |
| **Best for** | Bulk address and place lookups, data enrichment |

***

### What is forward geocoding?

**Forward geocoding** is the process of converting a text description of a location — a place name, landmark, or street address — into geographic coordinates (latitude and longitude). It's the opposite of *reverse geocoding*, which starts with coordinates and returns an address.

If you've ever typed an address into a map and gotten a pin back, you've used forward geocoding. This actor does the same thing, but at scale.

***

### Key features

- **Place names to coordinates** — landmarks, cities, addresses, or business names.
- **Bulk geocoding** — send one place or a whole list in a single run.
- **Fast** — even long lists finish quickly.
- **Clean, normalized output** — the same tidy fields every time: `query`, `name`, `country_code`, `lat`, `lng`.
- **Failures don't stop the run** — a place that can't be found returns an `error` entry while the rest keep going.

***

### Input

Geocoder accepts two kinds of input. Use either one.

#### Single place — `place`

A single place name, landmark, or address.

```json
{
  "place": "Eiffel Tower, Paris"
}
```

#### Multiple places — `places`

A list of places to geocode in one run.

```json
{
  "places": [
    "45 Wall St, New York",
    "Shibuya Crossing, Tokyo, Japan",
    "1600 Amphitheatre Parkway, Mountain View, CA",
    "10 Downing St, London, UK"
  ]
}
```

| Field | Type | Description |
|---|---|---|
| `place` | string | One place name, landmark, or address (up to 100 characters) |
| `places` | array of strings | A list of places to geocode in one run |

If you set both, `places` takes priority. If you leave both empty, the actor geocodes a default place — `45 Wall St, New York` — so you can try it instantly.

***

### How it works

1. You provide a `place` or a list of `places`.
2. Geocoder looks up each place and turns it into coordinates.
3. Clean results are pushed to the Apify **Dataset**.

***

### Output

Every place that resolves successfully becomes one item in the dataset:

```json
{
  "query": "Taj Mahal",
  "name": "Taj Mahal, Dharmapuri, Forest Colony, Tajganj, Agra, Uttar Pradesh",
  "country_code": "IN",
  "lat": 27.175144799999998,
  "lng": 78.0421422
}
```

| Field | Description |
|---|---|
| `query` | The exact text you searched for |
| `name` | The full resolved place name or formatted address |
| `country_code` | Country in ISO 3166-1 alpha-2 format (for example, `IN` or `US`) |
| `lat` | Latitude |
| `lng` | Longitude |

If a place can't be found, you still get an item — just with an error message instead of coordinates:

```json
{
  "query": "asdkjfhaskjdfh zzzz 12345",
  "error": "Place not found"
}
```

***

### Use cases

- **Enrich business data** with coordinates so you can map customers, stores, or leads.
- **Turn delivery or shipping addresses into map pins.**
- **Geo-tag photos, events, or assets** at scale.
- **Clean up messy location lists** before analytics or reporting.
- **Power location-based features** in your own app or dashboard.

***

### FAQ

**What's the difference between forward geocoding and reverse geocoding?**
Forward geocoding goes from text to coordinates ("Eiffel Tower" → 48.858, 2.294). Reverse geocoding goes the other way, from coordinates to an address.

**How many places can I geocode in one run?**
There's no hard limit — send a single place or a long list.

**What happens if a place can't be found?**
The run keeps going. That place gets its own item with an `error` field, and everything else is geocoded normally.

***

### Getting started

1. Open the **Geocoder** actor on Apify.
2. Enter a `place` or a list of `places`.
3. Click **Start**, then open the **Dataset** tab to see your results.

***

### Why Geocoder?

- **Simple** — one field for a single place, one for a list.
- **Fast** — even long lists finish quickly.
- **Reliable** — one bad place won't break the run.
- **Tidy output** — the same clean fields every time, ready for Excel, a database, or your code.

***

Questions or ideas? [Get in touch](https://apify.com/contact).

# Actor input Schema

## `place` (type: `string`):

A single place to geocode (e.g., Eiffel Tower, Times Square). Must be 100 characters or less.

## `places` (type: `array`):

List of place names to geocode (e.g., cities, addresses, landmarks).

## Actor input object example

```json
{
  "place": "45 Wall St, New York"
}
```

# Actor output Schema

## `results` (type: `string`):

One item per place with the resolved name, country_code, lat, and lng.

## `rawResponses` (type: `string`):

The full raw geocoding responses for this run, stored as a single record in the default key-value store.

# 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("poidata/forward-geocoder").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("poidata/forward-geocoder").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 poidata/forward-geocoder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,poidata/forward-geocoder"
        }
    }
}
```

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/Bgx6gY3h5qNcUqpl2/builds/idz8pN8op4guSstAE/openapi.json
