Is /cdn-cgi/trace considered stable?

Can I use the loc=<...> field from “service” as a “geolocation” service? Are there guidelines to doing so, and is the response based on nearest server (i.e. related to colo or the (approx) location of the actual user?)

It should be pretty stable, but you won’t have a guarantee either.

What is it you want to achieve? loc simply shows the country code of the IP address where the request came from.

I’m trying to understand if I can use the loc field of the trace to “geolocate” where I am making requests from. Else I could also make requests to a website I have hosted on Cloudflare and use the CF-IPCountry from the request header to understand the geolocation of my own requests, but that seems like more work.

So I want to understand if I can simply use for the same purpose.

That would work, though that field might change at any time without notice. I’d probably rather go with a specialised GeoIP service instead.

1 Like

That was my worry as well, plus there is no official documentation on what fields are/will be presented at cdn-cgi/trace


It isn’t really an official part of anything but rather assists debugging.

As long as you are aware that it can change at any time, you could use it for that purpose. Otherwise something of the sort of and similar services might be more appropriate.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.