0

I'm trying to obtain the "attributes" object associated with some businesses through Yelp's Fusion API. Although the search businesses endpoint seems to indicate an optional attributes object in its 200 response, I have not seen this populated in ~6000 businesses. Using the attributes filter does seem to work, affirming that businesses do indeed have attributes, but they are not being returned in the API response.

import requests

url = "https://api.yelp.com/v3/businesses/search?location=sf&attributes=reservation&sort_by=best_match&limit=1"

headers = {
    "accept": "application/json",
    "Authorization": "Bearer ACCESS_TOKEN"
}

response = requests.get(url, headers=headers)

print(response.text)

This request for instance, with an query parameter searching for businesses with attribute "reservation", does not include an attribute field in the business returned its response. In a similar vein, using the get business by ID endpoint also does not seem to produce an attribute field in the response. For example, this url.

url = "https://api.yelp.com/v3/businesses/bi-rite-creamery-san-francisco"

Is there anything I'm missing here? Can't seem to find how the attributes field can be exposed in the API response.

Infinitus
  • 155
  • 10

0 Answers0