The Addresses API resource retrieves the addresses associated to an user.
To make a call to this API you’ll need an access token.
curl -X GET "Content-Type: application/json" -d https://api.mercadolibre.com/users/{User_id}/addresses?access_token=$ACCESS_TOKEN
RESPONSE
{ "id": 145834937, "user_id": "160252486", "contact": null, "phone": null, "address_line": "Guatemala 5100", "floor": null, "apartment": null, "street_number": "5100", "street_name": "Guatemala", "zip_code": "1000", "city": -{ "id": "TUxBQlBBTDI1MTVa", "name": "Palermo", }, "state": -{ "id": "AR-C", "name": "Capital Federal", }, "country": -{ "id": "AR", "name": "Argentina", }, "neighborhood": -{ "id": null, "name": null, }, "municipality": -{ "id": null, "name": null, }, "search_location": -{ "state": -{ "id": "TUxBUENBUGw3M2E1", "name": "Capital Federal", }, "city": -{ "id": "TUxBQ0NBUGZlZG1sYQ", "name": "Capital Federal", }, "neighborhood": -{ "id": "TUxBQlBBTDI1MTVa", "name": "Palermo", }, }, "types": -[ "default_selling_address", "shipping", ], "comment": "", "geolocation_type": "RANGE_INTERPOLATED", "latitude": -34.5834729, "longitude": -58.4281022, "status": "active", "date_created": "2014-06-05T12:26:54.000-04:00", "normalized": true, "open_hours": -{ "on_holidays": -{ "hours": [ ], "status": "closed", }, }, }
GEOLOCATION TYPE:
The geolocation_type it’s a new attribute that tell us the approximation range of the user’s address according to the “latitude” and “longitude” parameters retrieved by Google Maps.
POSSIBLE VALUES FOR GEOLOCATION TYPE SUPPORTED BY GOOGLE
- “ROOFTOP” indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision.
- “RANGE_INTERPOLATED” indicates that the returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address.
- “GEOMETRIC_CENTER” indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region).
- “APPROXIMATE” indicates that the returned result is approximate.