API


Places

To generate all horoscopes you must first retrieve the place_id. It represents a geographical place on earth where on the astrological calculations are based.

Basic Flow

You can use the api/places endpoint but also by latitude, longitude and radius. You can perform AJAX-requests to the api/places/latlong endpoint that will return the top 10 places closest related to the input. The radius is maximized to 15 kilometers. Then the end-user selects the place where (s)he was born from the list. The associated id is the place_id you will need to use in subsequent requests to calculate the horoscopes.

1. Retrieving the place_id

POST /api/places/latlong

Header Value
Accept-Encoding application/json
Content-Type application/json
Authorization Bearer [accessToken]


body

{
    "lat": 40.6943,
    "long": -73.9249,
    "radius": 15
}


Response (shortened)

(Places are ordered by population DESC)

{
    {
        "data": [
            {
                "id": 1840034016,
                "name": "New York",
                "longitude": -73.9249,
                "latitude": 40.6943,
                "country_code": "US",
                "admin1_code": "US-NY",
                "population": 18713200,
                "timezone": "America/New_York"
            },
            {
                "id": 1840034030,
                "name": "Brooklyn",
                "longitude": -73.9496,
                "latitude": 40.6501,
                "country_code": "US",
                "admin1_code": "US-NY",
                "population": 2559900,
                "timezone": "America/New_York"
            },
            ...