This is an API developed with Python using Flask and JWT in order to have secure routes.
- Clone this repository
- Run
pip install -r requirements.txt
in the root directory - Run
python app.py
There is a Live example for this API deployed in Heroku. In order to start you have to make a request to the following URI
https://place-search-api.herokuapp.com/
The API routes are protected with JWT, so in order to use the routes, you need to login, to do this send a GET request with Basic Auth (see image)
The request has to be made to the following URI
GET https://place-search-api.herokuapp.com/login
Once the request has been made with a valid login information, it returns a token that needs to be save in order to made every request.
- GET PLACES
Send GET request to
GET https://place-search-api.herokuapp.com/search?location=<lat,lng>&radius=<radius in meters>&type=<type of the place>&keyword=<keyword to query the places>
Like the example above, the request needs to have the following required params:
1.Location
2.Radius
3.Type
4.Keyword
Since the routes are protected, the user needs to send the token in the header of the request with the key name "x-access-token" (see image)
The response it would be a JSON object with all the places from the requests of the Google Place's and Foursquare APIs.
- CREATE NEW USER
Send POST request to:
POST https://place-search-api.herokuapp.com/user
With the request, send username and password inside the body in JSON format (see image)
There are requirements that could not been fulfilled since the APIs does not provide this information or it wasn't very clear, in particular there are to element missing: Provider and Description.
In case of the Provider, there wasn't too much information to make an assumption about it. With the description, there was no way to get this information since this field was deprecated from the current versions of the APIs