Skip to main content
This page demonstrates calling the Enhance Location endpoint to enrich a single address with Ping.Data. Reach for this workflow when one of the following is true:
  • You have a single address and want enriched data returned synchronously in one HTTP call.
  • You’re powering an interactive use case such as a form lookup, address validation, or on-demand enrichment.
  • You don’t want to manage a polling loop or download a result file.
For batches of more than a handful of addresses, use Enhance Multiple Locations instead. The bulk endpoint accepts an array of locations in one request and produces a single downloadable output file. The examples show a simple GET-based call (query parameters) and a minimal Python script you can run locally. sources accepts datasource codes (e.g., PG, PH) from List Datasources, which returns the datasources your account has access to along with each one’s input requirements and geographic coverage. The code blocks allow the user to select from Python or cURL (via terminal) use cases. The sample Python script is available for download at the bottom of the page. Try filling in the blanks (e.g., {id}) to Enhance Location using cURL!

1. Enhance a Single Location

Example code:
enhance_location.py
import requests
import json
from pathlib import Path
import os

# authentication token that allows you to make requests to the API
API_KEY = os.environ.get('PING_DATA_AUTH_TOKEN')
headers = {"Authorization": f"Token {API_KEY}"}

# single-address example
params = {
    "address": "1600 pennsylvania ave nw washington dc 20500",
    "sources": ["PG", "PH"]
}

API_BASE = "https://data-api.sovfixer.com/api/v1"
url = f"{API_BASE}/enhance"
# 1. API URL for Enhance Location: https://data-api.sovfixer.com/api/v1/enhance
enhance_location_response = requests.get(url, headers=headers, params=params)
# check response status
if enhance_location_response.status_code not in (200, 201):
    print("Error:", enhance_location_response.status_code, enhance_location_response.text)
    raise Exception("Error enhancing location")

data = enhance_location_response.json()
print(json.dumps(data, indent=4))
Example response (truncated):
enhance_location.py
{'id': 'e92a9bbe-007b-11f1-bb2a-0242ac11000a',
 'location_data': {
                   'PG': {'address_line_1': '1600 Pennsylvania Ave NW',
                          'address_line_2': '',
                          'city': 'Washington',
                          ...

Python Demo

Download a ready-to-run Python demo of this workflow here:                                   Download Python Script here