Budget lookback query
curl --request POST \
--url https://api.nops.io/v1/budgets/lookback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"explorerReportId": "report-1",
"startDate": "2026-01-01",
"period": "MONTHLY",
"lookbackPeriod": 6,
"numberOfPeriods": 12
}
'import requests
url = "https://api.nops.io/v1/budgets/lookback"
payload = {
"explorerReportId": "report-1",
"startDate": "2026-01-01",
"period": "MONTHLY",
"lookbackPeriod": 6,
"numberOfPeriods": 12
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
explorerReportId: 'report-1',
startDate: '2026-01-01',
period: 'MONTHLY',
lookbackPeriod: 6,
numberOfPeriods: 12
})
};
fetch('https://api.nops.io/v1/budgets/lookback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nops.io/v1/budgets/lookback"
payload := strings.NewReader("{\n \"explorerReportId\": \"report-1\",\n \"startDate\": \"2026-01-01\",\n \"period\": \"MONTHLY\",\n \"lookbackPeriod\": 6,\n \"numberOfPeriods\": 12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"periods": [
{
"periodKey": "2026-01",
"actual": 15200.5
},
{
"periodKey": "2026-02",
"actual": 14800.25
}
]
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Budgets
Budget lookback query
Query historical spend for budget planning with filters.
POST
https://api.nops.io
/
v1
/
budgets
/
lookback
Budget lookback query
curl --request POST \
--url https://api.nops.io/v1/budgets/lookback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"explorerReportId": "report-1",
"startDate": "2026-01-01",
"period": "MONTHLY",
"lookbackPeriod": 6,
"numberOfPeriods": 12
}
'import requests
url = "https://api.nops.io/v1/budgets/lookback"
payload = {
"explorerReportId": "report-1",
"startDate": "2026-01-01",
"period": "MONTHLY",
"lookbackPeriod": 6,
"numberOfPeriods": 12
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
explorerReportId: 'report-1',
startDate: '2026-01-01',
period: 'MONTHLY',
lookbackPeriod: 6,
numberOfPeriods: 12
})
};
fetch('https://api.nops.io/v1/budgets/lookback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nops.io/v1/budgets/lookback"
payload := strings.NewReader("{\n \"explorerReportId\": \"report-1\",\n \"startDate\": \"2026-01-01\",\n \"period\": \"MONTHLY\",\n \"lookbackPeriod\": 6,\n \"numberOfPeriods\": 12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"periods": [
{
"periodKey": "2026-01",
"actual": 15200.5
},
{
"periodKey": "2026-02",
"actual": 14800.25
}
]
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Was this page helpful?
⌘I