Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b3ece30
Grab the Go IP Intelligence examples by their names in 51degrees-go (…
jwrosewell Nov 3, 2026
3214916
Show the Java benchmarks from 51degrees-java and restore the .NET dev…
jwrosewell Nov 3, 2026
4520a73
Merge main into rc after the 4 November release
jwrosewell Nov 4, 2026
6ba0689
Point the data file steps at the data repository (#288)
jwrosewell Nov 4, 2026
b7ab5da
Add PHP to the nightly benchmarks (#291)
jwrosewell Nov 4, 2026
f764bdb
Merge main into rc after release #292
jwrosewell Nov 4, 2026
73b54db
Say precise, not accurate, where the pages describe how far an IP loc…
jwrosewell Nov 5, 2026
75a30ae
Merge main into rc after release #294
jwrosewell Nov 5, 2026
87eab56
Plainer wording, small fixes and sentence case headings (#298)
jwrosewell Nov 6, 2026
24cf3c9
Fail a preview publish whose push is refused, and skip closed pull re…
jwrosewell Nov 6, 2026
6b52086
Send header search questions to the 51degrees.com assistant (#296)
jwrosewell Nov 6, 2026
7bfa219
Link the example snippets to the contact page for the Enterprise file…
jwrosewell Nov 6, 2026
aba6954
Say that a set of results is used by one thread at a time (#267)
jwrosewell Nov 6, 2026
9e573e7
Correct statements that no longer match the code, the service or the …
jwrosewell Nov 6, 2026
6682b1d
DATA: Apple-device-tables-v1.1011132 (#290)
Rakesh51D Nov 6, 2026
6ce54cf
CONT: Fixed typos on both TAC lookup and Native Key lookup pages - ve…
Tracy51D Nov 6, 2026
8529cbe
Merge main into rc after release #301
jwrosewell Nov 6, 2026
fbcc6ae
Space out list items in the documentation (#306)
jwrosewell Nov 9, 2026
03fd8b8
Document 51degrees.com/json for support requests and scripts (#309)
jwrosewell Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
p, ul, ol {
margin: 0 0 size(0) 0;
}
// Space between list items, so long items read as separate points.
li + li {
margin-top: size(-2);
}
a {
@include make-link-docs();
}
Expand Down
2 changes: 2 additions & 0 deletions src/services/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
- @subpage Services_Distributor

- @subpage Services_Cloud_Index

- @subpage Services_Json
104 changes: 104 additions & 0 deletions src/services/json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
@page Services_Json Your connection and device as JSON

[51degrees.com/json](https://51degrees.com/json) is for support. A customer opens it in the browser that is giving them trouble and pastes the answer into their ticket, so support has the details without asking for each in turn.

It returns what 51Degrees finds for the request that asks for it: the IP address with its location and network, and the device, operating system, and browser that sent the request. It needs no Resource Key and no account.

It only works in a real web browser. Open it in a browser to see the answer for that browser. Curl and other command-line tools are treated as crawlers, and crawlers of any kind are sent to [the AI notice](https://51degrees.com/ai-notice), which explains how to license the data, rather than given an answer.

# Paste the answer into a support request

The answer is indented JSON, so it can be copied as it is into a ticket, an email, or a chat. Ask the person with the problem to open https://51degrees.com/json in the browser where the problem happens and paste what it shows. Support then has the browser and its version, the operating system, the type of device, and the connection in one block, rather than asking for each in turn.

# What it returns

This is the answer 51degrees.com/json gave a computer at 51Degrees on 11 November 2026, for Edge 157 on Windows 11, with the IP address replaced by one reserved for documentation, the town and position replaced by a position in Reading, and the network's registered name replaced by an example. The data can't yet date Edge 157, and a desktop computer doesn't say who made it, so both release years are 0.

```
{
"ip": {
"ip": "192.0.2.10",
"town": "Reading",
"region": "England",
"country": "United Kingdom",
"countrygeonameid": "2635167",
"latitude": 51.454,
"longitude": -0.978,
"locationconfidence": "High",
"registeredname": "EXAMPLE-NETWORK",
"connectiontype": "Broadband"
},
"device": {
"hardwarevendor": "Unknown",
"hardwaremodel": "Unknown",
"devicetype": "Desktop",
"releaseyear": 0,
"releaseage": 0,
"platformname": "Windows",
"platformversion": "11.0",
"platformreleaseyear": 2021,
"platformreleaseage": 65,
"browsername": "Edge (Chromium) for Windows",
"browserversion": "157",
"browserreleaseyear": 0,
"browserreleaseage": 0
}
}
```

The `ip` part describes the IP address the request came from.

| Key | What it holds |
|-----|---------------|
| `ip` | The IP address the answer is for. |
| `town`, `region`, `country` | The town, region, and country the address is in. |
| `countrygeonameid` | The [GeoNames](https://www.geonames.org/) identifier of the country. |
| `latitude`, `longitude` | The average location of the address, moved at random by up to about 1 kilometer. See @ref IpIntelligence_Features_Randomization "Randomization". |
| `locationconfidence` | High, Medium, Low, or Unknown. Check it before relying on the town or the coordinates. |
| `registeredname` | The name of the IP range, which is usually its owner. |
| `connectiontype` | The kind of connection, such as Broadband or Cellular. |

The `device` part describes what sent the request, from its headers.

| Key | What it holds |
|-----|---------------|
| `hardwarevendor`, `hardwaremodel` | The company that makes or sells the device, and the model name or number it uses. |
| `devicetype` | The type of device, such as Desktop, SmartPhone, or Tablet. |
| `releaseyear`, `releaseage` | The year the device was released, and the months since. |
| `platformname`, `platformversion` | The operating system and its version. |
| `platformreleaseyear`, `platformreleaseage` | The year that operating system version was released, and the months since. |
| `browsername`, `browserversion` | The browser and its version. |
| `browserreleaseyear`, `browserreleaseage` | The year that browser version was released, and the months since. |

Unknown, or a release year of 0, means the request did not carry enough to tell, and the age beside a release year of 0 is 0 too. A desktop computer, for example, does not say who made it. A release year is also 0 where the data has no release date for a version it did identify, such as Edge 157 in the sample above. An age of 0 with a release year means the release was this month. If the 51Degrees cloud service gives no answer, that part is `null`.

The [Property Dictionary](https://51degrees.com/developers/property-dictionary) describes each property in full.

# Call it from code

From a web page on any website, use `fetch`. The answer carries `Access-Control-Allow-Origin: *`, so browsers allow the call from any site. A request that is throttled, or that comes from a crawler, is redirected to a page that doesn't allow calls from other sites, so the call fails rather than returning an answer. Catch that, and check the response before reading it.

```
try {
const response = await fetch('https://51degrees.com/json');
if (!response.ok || response.redirected) {
throw new Error('51degrees.com/json gave no answer');
}
const you = await response.json();
console.log(you.device.browsername, you.device.browserversion, you.ip.country);
} catch (error) {
console.log('No answer from 51degrees.com/json', error);
}
```

The answer is always fresh, because it is sent with `Cache-Control: no-store`.

# Throttling

51degrees.com/json is throttled to prevent abuse, and the throttling can change. A request that is turned away, or that comes from a crawler, is redirected and does not get the JSON answer, so code that calls it should check the response before using it.

For more requests, other IP addresses or User-Agents, or more properties, @ref Services_Configurator "create a Resource Key" and call the @ref Services_Cloud_Overview "cloud service" yourself.

# What is sent to the cloud

To answer, 51degrees.com sends the IP address and headers of the request to the 51Degrees cloud service, leaving out cookies and authorization headers. It also counts the requests from each caller, to throttle the page.
Loading