An open API service indexing awesome lists of open source software.

https://github.com/rajgoesout/apitest


https://github.com/rajgoesout/apitest

Last synced: 21 days ago
JSON representation

Awesome Lists containing this project

README

        

# apitest

## Usage

```
$ psql mydb
mydb=# CREATE EXTENSION cube;
mydb=# CREATE EXTENSION earthdistance;
```

```
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ export FLASK_ENV=development
$ python app.py
```

## Endpoints

### Create Location

`POST /api/post_location`

Example request body:

```json
{
"accuracy": null,
"admin_name1": "San Andreas",
"key": "IN/200003",
"latitude": 25.5,
"longitude": 71.4,
"place_name": "San Fierro"
}
```

### Get Places within 5km (earthdistance)

`GET /api/get_using_postgres`

Returns an array of places within 5km radius of queried point using postgres earthdistance extension.

Query Parameters:

`?latitude=28.6333&longitude=77.2167`

### Get Places within 5km (self computed)

`GET /api/get_using_self`

Returns an array of places within 5km radius of queried point.

Query Parameters:

`?latitude=28.6333&longitude=77.2167`