Geolocation Data Arrives on Cloudflare Workers
Cloudflare has extended its Workers serverless platform with free, integrated geolocation data. Developers on every plan, including the free tier, can now read request-level location fields without any additional configuration or user opt-in. The location context is derived from the network edge, so it applies to every request a Worker handles.
Each incoming request to a Worker carries a set of geographic properties, such as:
- Country:
"US" - City:
"Austin" - Continent:
"NA" - Latitude:
"30.27130" - Longitude:
"-97.74260" - Postal code:
"78701" - Metro code (DMA):
"635" - Region:
"Texas" - Timezone:
"America/Chicago"
This data is exposed server-side through the Worker runtime, which opens up several practical approaches to building location-aware services, such as shipping cost calculations, language selection, or region-specific content delivery. Refer to the official request properties documentation for the full field list and access patterns.
Server-Side Personalization Without Client-Side Overhead
One notable advantage of using geolocation in Workers is the shift away from client-side personalization techniques. Traditional web apps often rely on JavaScript or cookies to detect a user's context, which can delay rendering and add complexity. With Workers, the server can deliver a customized response immediately, avoiding the need for round-trip requests to adjust the UI.
For example, a Worker can read the timezone field to determine the current local time and render a page with a matching color scheme—daylight gradients during the day and darker tones at night. The same pattern can be used to implement automatic dark mode without storing preferences on the client.
Example Workers to Explore
Cloudflare has published three reference implementations that demonstrate how to use the new capabilities:
- Hello World — A minimal Worker that exposes all available geolocation fields and shows how to access each one.
- Personalized UI Design — A Worker that adjusts its visual theme based on the user's local time, illustrating a pure server-rendered personalization approach.
- Location-Based Applications — A Worker that fetches air quality data from the World Air Quality Project's API based on the request's latitude and longitude.
Each example includes documented source code and a deployed live demo, linked from Cloudflare's developer documentation. Developers interested in building more advanced use cases can refer to the documentation for the runtime APIs and field definitions. The ability to combine geolocation with other Workers features positions the platform for a wide range of edge-compute use cases, from localized analytics to regional review systems.



