curl --request GET \
--url "https://rtb.example.com/v1/weights" \
--header "Authorization: <api-key>"
import requests
response = requests.get(
"https://rtb.example.com/v1/weights",
headers={"Authorization": "<api-key>"},
)
weights = response.json()
const response = await fetch("https://rtb.example.com/v1/weights", {
headers: { Authorization: "<api-key>" },
});
const weights = await response.json();
{
"current": {
"version": "w-2",
"weights": {
"views": 1,
"comments": 0.5,
"up": 0.25,
"downvote_share": 0.5
},
"note": "add comments and up-votes",
"set_at": "2026-09-30T03:00:00+09:00",
"first_cycle_time": "2026-09-30T03:05:00+09:00"
},
"previous": {
"version": "w-1",
"weights": {
"views": 1,
"comments": 0,
"up": 0,
"downvote_share": 0
},
"note": "first trial: views only",
"set_at": "2026-09-29T02:02:11+09:00",
"first_cycle_time": "2026-09-29T02:05:00+09:00"
}
}
Learning API
Get Weights
The publish-score weights in force, and the version before them.
GET
/
v1
/
weights
curl --request GET \
--url "https://rtb.example.com/v1/weights" \
--header "Authorization: <api-key>"
import requests
response = requests.get(
"https://rtb.example.com/v1/weights",
headers={"Authorization": "<api-key>"},
)
weights = response.json()
const response = await fetch("https://rtb.example.com/v1/weights", {
headers: { Authorization: "<api-key>" },
});
const weights = await response.json();
{
"current": {
"version": "w-2",
"weights": {
"views": 1,
"comments": 0.5,
"up": 0.25,
"downvote_share": 0.5
},
"note": "add comments and up-votes",
"set_at": "2026-09-30T03:00:00+09:00",
"first_cycle_time": "2026-09-30T03:05:00+09:00"
},
"previous": {
"version": "w-1",
"weights": {
"views": 1,
"comments": 0,
"up": 0,
"downvote_share": 0
},
"note": "first trial: views only",
"set_at": "2026-09-29T02:02:11+09:00",
"first_cycle_time": "2026-09-29T02:05:00+09:00"
}
}
Overview
Not in MVP scope. Until it is available, the weights stay at the first-trial setting:
views = 1 and every other weight 0. Every cycle response already names the weights_version in use.PUT /v1/weights took effect, and to see which weights a weights_version in a cycle response stands for.Weights set with
PUT /v1/weights show as current from the cycle named in first_cycle_time. Before that cycle, the previous version is still the one scoring.Response Attributes
object
required
Show properties
Show properties
string
required
Weights version.
object
required
Publish-score weights. At least one of
views, comments and up must be above 0.Show properties
Show properties
number
required
Weight on
p_views.number
required
Weight on
p_comments.number
required
Weight on
p_up.number
required
Weight on the predicted down-vote share. It is subtracted, so send it as a positive number.
integer
Reserved for the later hide head. Must be 0 or left out.
integer
Reserved for the later deletion head. Must be 0 or left out.
string | null
The note sent with the weights, or
null.string
required
When the weights were accepted.
string
required
The first cycle the weights applied to.
object | null
required
The version before the current one, or
null if there is none.Show properties
Show properties
string
required
Weights version.
object
required
Publish-score weights. At least one of
views, comments and up must be above 0.Show properties
Show properties
number
required
Weight on
p_views.number
required
Weight on
p_comments.number
required
Weight on
p_up.number
required
Weight on the predicted down-vote share. It is subtracted, so send it as a positive number.
integer
Reserved for the later hide head. Must be 0 or left out.
integer
Reserved for the later deletion head. Must be 0 or left out.
string | null
The note sent with the weights, or
null.string
required
When the weights were accepted.
string
required
The first cycle the weights applied to.
curl --request GET \
--url "https://rtb.example.com/v1/weights" \
--header "Authorization: <api-key>"
import requests
response = requests.get(
"https://rtb.example.com/v1/weights",
headers={"Authorization": "<api-key>"},
)
weights = response.json()
const response = await fetch("https://rtb.example.com/v1/weights", {
headers: { Authorization: "<api-key>" },
});
const weights = await response.json();
{
"current": {
"version": "w-2",
"weights": {
"views": 1,
"comments": 0.5,
"up": 0.25,
"downvote_share": 0.5
},
"note": "add comments and up-votes",
"set_at": "2026-09-30T03:00:00+09:00",
"first_cycle_time": "2026-09-30T03:05:00+09:00"
},
"previous": {
"version": "w-1",
"weights": {
"views": 1,
"comments": 0,
"up": 0,
"downvote_share": 0
},
"note": "first trial: views only",
"set_at": "2026-09-29T02:02:11+09:00",
"first_cycle_time": "2026-09-29T02:05:00+09:00"
}
}
Authorizations
The API key issued for the environment, sent as the whole header value. Two keys are valid during a rotation.