curl --request GET \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand"
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"state": "ok",
"window": {
"days": 30,
"fromUtcDate": "<string>",
"toUtcDate": "<string>",
"area": "zone",
"zone": "<string>",
"weekStart": "<string>"
},
"zoneLabel": "<string>",
"area": {
"source": "travel_zone",
"cells": 1,
"complete": true,
"label": "<string>"
},
"grid": {
"booked": [
[
{
"level": 2,
"count": 1
}
]
],
"searched": [
[
{
"level": 2,
"count": 1
}
]
],
"unfilled": [
[
{
"level": 2,
"count": 1
}
]
]
},
"bookableMask": [
[
true
]
],
"glance": {
"bookableHours": 1,
"busyBookableHours": 1,
"busyNotBookableHours": 1,
"ranges": [
{
"day": "MON",
"start": "<string>",
"end": "<string>",
"bookable": true,
"level": 3
}
]
},
"suggestions": [
{
"key": "<string>",
"day": "MON",
"start": "<string>",
"end": "<string>",
"booked": 1,
"kind": "open",
"unfilled": 1,
"prefill": {
"weeklyTimeRanges": [
{
"dayOfWeek": "MO",
"startTime": "09:00",
"endTime": "17:00",
"crossesMidnight": false,
"sortOrder": 0
}
]
}
}
],
"asOf": "2023-11-07T05:31:56Z",
"complete": true
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}The signed-in supplier’s Week & demand view
Booked, searched and unfilled demand by hour of week over the supplier’s area, with their bookable hours, a glance and suggestions — the same view the MarketBox dashboard shows them. Hours are the supplier’s home zone, derived per instant from the rollup’s UTC buckets. Counts of 1–2 read “few”; fewer than 20 bookings in the window is not_enough_data with no grid. Requires the API key and the supplier’s user token. 403 INSIGHTS_DISABLED when the project’s Week & demand switch is off.
curl --request GET \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand"
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers/me/demand")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"state": "ok",
"window": {
"days": 30,
"fromUtcDate": "<string>",
"toUtcDate": "<string>",
"area": "zone",
"zone": "<string>",
"weekStart": "<string>"
},
"zoneLabel": "<string>",
"area": {
"source": "travel_zone",
"cells": 1,
"complete": true,
"label": "<string>"
},
"grid": {
"booked": [
[
{
"level": 2,
"count": 1
}
]
],
"searched": [
[
{
"level": 2,
"count": 1
}
]
],
"unfilled": [
[
{
"level": 2,
"count": 1
}
]
]
},
"bookableMask": [
[
true
]
],
"glance": {
"bookableHours": 1,
"busyBookableHours": 1,
"busyNotBookableHours": 1,
"ranges": [
{
"day": "MON",
"start": "<string>",
"end": "<string>",
"bookable": true,
"level": 3
}
]
},
"suggestions": [
{
"key": "<string>",
"day": "MON",
"start": "<string>",
"end": "<string>",
"booked": 1,
"kind": "open",
"unfilled": 1,
"prefill": {
"weeklyTimeRanges": [
{
"dayOfWeek": "MO",
"startTime": "09:00",
"endTime": "17:00",
"crossesMidnight": false,
"sortOrder": 0
}
]
}
}
],
"asOf": "2023-11-07T05:31:56Z",
"complete": true
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Authorizations
API key minted in the MarketBox dashboard. Scope is restricted to the projects you select at creation time. Every route needs the key's standard API access (*) except POST /v1/projects/{projectId}/events, which needs events:write; a key without * is refused with 403 CAPABILITY_NOT_GRANTED.