Public
Edited
Sep 20, 2024
Insert cell
Insert cell
viewof secretKey = secret("Random.org API Key", {
description:
"This is a secret API token whose value is only available to you!",
submit: "Set Random.org API Key"
})
Insert cell
{
const url = 'https://api.random.org/json-rpc/4/invoke';
const payload = {
"jsonrpc": "2.0",
"method": "generateIntegers",
"params": {
"apiKey": secretKey,
"n": 6,
"min": 1,
"max": 6,
"replacement": true
},
"id": 42
};
const params = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
};
const req = fetch(url, params)
.then(response => response.json())
.then(response => response.result.random.data)

return req
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more