Skip to content

Python API with Integration of Google Places and Foursquare

Notifications You must be signed in to change notification settings

jrleon90/python-places-search-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Places API

Table of Content

  1. Introduction
  2. Installation
  3. Live example
  4. API Docs
  5. Special Notes

Introduction

This is an API developed with Python using Flask and JWT in order to have secure routes.

Installation

  1. Clone this repository
  2. Run pip install -r requirements.txt in the root directory
  3. Run python app.py

Live Example

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/

API Docs

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) alt text 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.

  1. 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) alt text

The response it would be a JSON object with all the places from the requests of the Google Place's and Foursquare APIs.

  1. 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)

alt text

Special Notes

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

About

Python API with Integration of Google Places and Foursquare

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages