> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pingintel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enhance One Location

> Example for enhancing a single location via the **Ping.Data** API

This page demonstrates calling the [Enhance Location](/ping-data/enhance/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](/workflows/ping-data/bulk-enhance) 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](/ping-data/usage/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:**

<CodeGroup dropdown>
  ```python enhance_location.py lines icon='python' theme={null}
  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))
  ```

  ```shell cURL output icon='square-terminal' theme={null}
  curl --request GET \
    --url 'https://data-api.sovfixer.com/api/v1/enhance?sources=PG&sources=PH&address=1600%20pennsylvania%20ave%20nw%20washington%20dc%2020500' \
    --header "Authorization: Token <your_token_here>"
  ```
</CodeGroup>

**Example response (truncated):**

<CodeGroup dropdown>
  ```python enhance_location.py lines icon='python' theme={null}
  {'id': 'e92a9bbe-007b-11f1-bb2a-0242ac11000a',
   'location_data': {
                     'PG': {'address_line_1': '1600 Pennsylvania Ave NW',
                            'address_line_2': '',
                            'city': 'Washington',
                            ...
  ```

  ```shell cURL output icon='square-terminal' theme={null}
  {
    "id": "e92a9bbe-007b-11f1-bb2a-0242ac11000a",
    "location_data": {
      "PGPRE": {
        "is_success": true,
        "error_message": null,
        "confidence": 50,
        "status_code": 200,
          ...
  ```
</CodeGroup>

### Python Demo

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

               
                 
<a href="https://raw.githubusercontent.com/pingintel/pingintel-api/main/examples/ping-data/enhance_one_location.py" download>Download Python Script here</a>
