positionstack API

Geocoding / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

positionstack is a geocoding API that converts street addresses into latitude and longitude coordinates (forward geocoding) and vice versa (reverse geocoding). It supports batch processing, making it efficient for converting many addresses at once. An API key is required and can be obtained from the positionstack website.

Beginner Tip

Always URL-encode your address query string to handle spaces and special characters correctly. The free plan supports forward geocoding only; upgrade for reverse geocoding access.

Available Data

IP address details
latitude and longitude
city and country
timezone
ISP information

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from positionstack",
    "description": "Forward & Reverse Batch Geocoding REST API",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

latitude Latitude of the geocoded location in decimal degrees.
longitude Longitude of the geocoded location in decimal degrees.
label Full formatted address string returned by the geocoder.
confidence Confidence score from 0 to 1 indicating how well the query matched the result.
country_code ISO 3166-1 alpha-2 country code for the result location.

Implementation Example

Request
const url = "https://positionstack.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized or invalid_access_key The API key is missing, incorrect, or not yet activated.
Sign up at positionstack.com, copy your access key from the dashboard, and pass it as the access_key query parameter.
Empty data array in response The address could not be geocoded, possibly due to a typo or unsupported location.
Double-check the address spelling, include the country code for better accuracy (e.g., country=US), and simplify the query if needed.
HTTP 403 on HTTPS endpoint (free plan) The free tier only allows HTTP requests, not HTTPS.
Use http:// instead of https:// on the free plan, or upgrade to a paid plan for secure connections.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Geocoding
Difficulty Intermediate
Verified: 2026-04-04

Related Tags

Alternatives to positionstack

Technical alternatives for different use cases.

Forward and reverse geocoding with timezone info

Better For

US-specific features like census tract data

Trade-off

Simple geocoding with timezone detection

Similar APIs

View All →