If you have the name and location, use lookup: location_name & address to retrieve the Placekey of a specific POI or to fill out any fields you may be missing.

query {
  lookup(
    query: {
      location_name: "Locanda Ravello"
      street_address: "172 E Prospect Ave"
      city: "Danville"
      region: "CA"
      iso_country_code: "US"
    }
  ) {
    placekey
    safegraph_core {
      location_name
      street_address
      city
      region
      iso_country_code
      postal_code
    }
  }
}
curl --location --request POST 'https://api.safegraph.com/v1/graphql' \
--header 'apikey: {your-api-key}' \
--header 'content-type: application/json' \
--data-raw '{"query":"query {\n\tlookup(\n    query: {\n      location_name: \"Locanda Ravello\"\n      street_address: \"172 E Prospect Ave\"\n      city: \"Danville\"\n      region: \"CA\"\n      iso_country_code: \"US\"\n    }\n  ) {\n    placekey\n    safegraph_core {\n      location_name\n      street_address\n      city\n      region\n      iso_country_code\n      postal_code\n  \t}\n  }\n}","variables":{}}'
# pip install safegraphQL
import safegraphql.client as sgql

sgql_client = sgql.HTTP_Client(apikey = 'your-api-key')

location_name = 'Locanda Ravello'
street_address = '172 E Prospect Ave'
city = 'Danville'
region = 'CA'
iso_country_code = 'US'

cols = [
    'location_name',
    'street_address',
    'city',
    'region',
    'iso_country_code',
    'postal_code'
]

sgql_client.lookup_by_name(
    product = 'core', 
    location_name = location_name,
    street_address = street_address,
    city = city,
    region = region,
    iso_country_code = iso_country_code,
    columns = cols
)
{
  "data": {
    "lookup": {
      "placekey": "[email protected]",
      "safegraph_core": {
        "location_name": "Locanda Ravello",
        "street_address": "172 E Prospect Ave",
        "city": "Danville",
        "region": "CA",
        "iso_country_code": "US",
        "postal_code": "94526"
      }
    }
  },
  "extensions": {
    "row_count": 1,
    "version_date": "1635494405__2021_10"
  }
}