The Cloud Service comes in two forms: the Cloud hosted by 51Degrees, which this page describes, and the Self-Hosted Docker image, which serves the same API from your own infrastructure and authenticates with your License Key alone, supplied once when the container starts.

There are a couple methods to integrate the hosted Cloud Service, but regardless of the integration method you will need a credential, which is either a Resource Key or, for a server that manages its own property list, a License Key.


Authentication🔗

Supply a Resource Key in any of these places, checked in order (first match wins): HTTP header (X-51D-Resource-Key), route (/api/v4/<resource_key>.json), query string (?resource=), or form body. A License Key is supplied the same way but has no v4 route: HTTP header (X-51D-License-Key), query string (?license=), or form body. Form fields are only read from a POST request.

A License Key alone works on the routes a server calls, and on json and js the caller must then list the properties they want with the values parameter (the X-51D-Values header, ?values=, or a form field). See Resource Keys for which routes take each key and how the two combine.

Most v4 responses, including the detection endpoints, are cacheable only by the caller's own cache (Cache-Control: private). A few endpoints that never return cacheable content, such as /api/v4/info, /api/v4/resource and /api/v4/oauth, return Cache-Control: no-store. When a credential or the values list is supplied via an X-51D-* header rather than in the URL, the response is returned Cache-Control: no-store instead, since the header is not part of the URL a shared cache would key on.


RESTful API🔗

Call the Cloud Service directly through its REST API. See the Cloud REST API reference.


Libraries🔗

Cloud Service can also be used via a language-specific library wrapping the API calls:

See corresponding examples for one of the services: