From 7dcb08c5db609823dd98902b374c8097bf0461fd Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Tue, 24 Apr 2018 16:02:00 +0200 Subject: [PATCH] Update README.md --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8e491c3..ef8bac4 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,85 @@ -# API POSTAL CODE WALLAVISO +# API para Códigos postales de España -## URL +Sencilla API para obtener información de los códigos postales de España. Obteniendo información como: -https://hidden-sierra-35586.herokuapp.com +- Código postal. +- Población. +- Latitud. +- Longitud. -## REQUESTS +## Llamadas -### Get for index -https://hidden-sierra-35586.herokuapp.com/api/v1/index/{integer} +### Obtener todos los datos de un código postal -### Get for postal code -https://hidden-sierra-35586.herokuapp.com/api/v1/postal_code/{integer} +``` bash +https://hidden-sierra-35586.herokuapp.com/api/v1/postal_code/{numero} +``` -## INSTALL +Ejemplo + +``` bash +https://hidden-sierra-35586.herokuapp.com/api/v1/postal_code/46017 +``` + +``` json +[ + { + "index": 461021, + "postal_code": 46017, + "poblacion": "Santa Margarida de Montbui", + "lat": 41.55659597, + "lng": 1.60489809 + }, + { + "index": 461022, + "postal_code": 46017, + "poblacion": "Pampliega", + "lat": 42.20619881, + "lng": -3.98797885 + }, + { + "index": 461023, + "postal_code": 46017, + "poblacion": "Villanueva de Guadamejud", + "lat": 40.22470982, + "lng": -2.50703229 + }, + ... +] +``` + +### Obtener por index (indice) + +``` bash +https://hidden-sierra-35586.herokuapp.com/api/v1/index/{indice} +``` + +Ejemplo + +``` bash +https://hidden-sierra-35586.herokuapp.com/api/v1/index/461021 +``` + +``` json +[ + { + "index": 461021, + "postal_code": 46017, + "poblacion": "Santa Margarida de Montbui", + "lat": 41.55659597, + "lng": 1.60489809 + } +] +``` + +## Instalación ```bash pipenv install pipenv shell ``` -## RUN +Después solo debes arrancarlo. ```bash python3 app.py