summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2015-11-19 11:02:12 -0500
committerBen Burwell <ben@benburwell.com>2015-11-19 11:02:12 -0500
commit81f58028b6e7473a78d8de0070bd6511287fbe0a (patch)
tree7b41af196f9a549d2067826aebcc6c1f26998776 /README.markdown
parentfe22af7afdd2cffbd8395c7151f6e957db36f065 (diff)
parent5be5fe170fd317a0ed5b85b513ccf3f52e433521 (diff)
Merge pull request #1 from benburwell/distance-calc
Add distance calculation functionality
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 887b833..6ac6da7 100644
--- a/README.markdown
+++ b/README.markdown
@@ -15,6 +15,23 @@ To get zipcode info using `curl` and [`jq`](https://stedolan.github.io/jq/):
curl --silent http://localhost:8080/zip/18101 | jq '.'
```
+# Response
+
+Your response will look something like this:
+
+```json
+{
+ "latitude": 40.602847,
+ "longitude": -75.47022,
+ "city": "Allentown",
+ "state": "PA"
+}
+```
+
+If the zipcode you request isn't in the database, you'll get a `404` status with an empty body.
+
+Add a `?distance=` parameter to your request to see how far away two zipcodes are. The response format will be the same as above with an additional `distance` key that contains info about the second zipcode as well as `miles` and `kilometers` keys. If the second zipcode can't be found, the `distance` key won't be included.
+
# Data
This project uses public-domain zipcode data from the [Zip Code Database Project](http://zips.sourceforge.net).