Skip to content

Commit 15ab7ae

Browse files
committed
Add example response in README
1 parent 4db8feb commit 15ab7ae

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
11
## Postcode to address API
2-
This is a web API that fetches data from [openaddresses](https://openaddresses.io/) provide postcode verification.
2+
This is a web API that fetches data from [openaddresses](https://openaddresses.io/) and provides postcode verification.
3+
It can be useful to verify user input, or pre-fill information (for example, the delivery address in a shopping cart).
34

45
Currently the data is only available for the Netherlands but the API could be extended to support multiple of the countries available on [openaddresses](https://openaddresses.io/).
56

67
##### Example requests
78
`GET /addresses?postcode=1011PN`
89
`GET /addresses?postcode=1011PN&number=1`
910

11+
If the postcode is valid, you will get back the list of addresses associated to it.
12+
```json
13+
[
14+
{
15+
"id":"5573a555-2ba2-4247-bf76-c2977d47fe8e",
16+
"lat":52.367645263671875,
17+
"lon":4.900165557861328,
18+
"number":"1",
19+
"street":"Amstel",
20+
"city":"Amsterdam",
21+
"region":"Noord-Holland",
22+
"postcode":"1011PN"
23+
}
24+
]
25+
```
26+
1027
##### Query parameters
11-
- `postcode` must be a valid postcode (check https://en.wikipedia.org/wiki/Postal_codes_in_the_Netherlands)
28+
- `postcode` must be a valid postcode (check https://en.wikipedia.org/wiki/Postal_codes_in_the_Netherlands).
1229
- `number` is optional. When not specified, all the addresses associated with the postcode will be returned.
1330

1431
### Technologies
1532
- [Actix web 2.0](https://github.com/actix/actix-web)
1633
- [Diesel](https://github.com/diesel-rs/diesel)
1734
- [Postgres](https://www.postgresql.org/)
1835

19-
You can run the service by using Docker, or locally (with Rust >= 1.40 and a Postgres instance)
36+
You can run the service by using Docker, or locally (with Rust >= 1.40 and a Postgres instance).
37+
The first start will take a couple of minutes, as the service needs to fetch millions of address records.

0 commit comments

Comments
 (0)