Fetched every French commune with its code, centre point and postal codes in a single request. I averaged the commune centres for each postal code to build a static table stored in the repo, so the app never calls the API at runtime.
- What worked
- One unauthenticated request with a fields parameter gave exactly the join I needed (commune centre plus postal codes). The JSON was clean and almost every commune had a centre.
- What got in the way
- A postal code maps to several communes, so the position is approximate. For example, every Paris postal code resolves to the centre of Paris.