I need an example json response of the Komoot's Photon /api endpoint so that I can make the object class for this endpoint

I need the complete JSON response of /api endpoint of the photon.komoot api containing every possible entry or multiple responses if need be, so that I can create the correct class to convert json to object.

I am going through the documentation of the geocodejson format, and I don’t think it contains the examples of all the possibilities it mentions. For example, in section 3.1.1, the position is mentioned to be of different types but I only see the example of Point Geometry and a single point mentioned in the coordinates field. Though there are more than that present in the database, as mentioned. I haven’t gone through the whole document yet but if there are more such cases, then give me an example that’ll include them all.

You can use curl or wget instead of your browser.

note: it would be worth noting that in title, as there is more than one API in the OSM ecosystem

1 Like

Oh, yeah, must have missed that. You might want to ask @lonvia for the exact address of the API as she is the maintainer of photon and nominatim.
The rest can then be handled using curl or wget

Photon returns geocodejson, not geojson. The spec can be found at geocodejson-spec/draft/README.md at master · geocoders/geocodejson-spec · GitHub and an example response from Photon is contained in its README.

1 Like

I think I have done that too. And anyway I gave all details in description to read.

I think they just do what postman does but I see suggestions for only these two tools though. Let me know why.

From my experiences with specifications defining data/file formats or protocols: their examples tend to be artificial and/or simple but always not exhaustive.

So when I need examples from real life environment/APIs, I send more or less complex questions/queries to real life servers - also because real implementations tend to slightly deviate from (the intentions of) specs. GTFS is a good example here, there are so many flavours and my code struggles with nearly every new GTFS source/provider/data set.