Additionally, you can get deep insights into how your Sequence Marketplace is performing so you can report, track, and refine to earn more revenue.
Replace the PROJECT_ID and SECRET_API_ACCESS_KEY variables with your project ID and
secret token from Sequence Builder.
Fetch Transactions on your Marketplace
Fetching the number of transaction events on the Sequence marketplace - these can used either be by total or a fixed time interval.
Total
curl 'https://api.sequence.build/rpc/Analytics/MarketTxnEventTotal' \
-H 'accept: */*' \
-H 'authorization: BEARER <SECRET_API_ACCESS_KEY>' \
-H 'content-type: application/json' \
--data-raw '{"filter":{"projectId":<PROJECT_ID>,"startDate":"2024-04-23","endDate":"2024-05-23"}}'
// Works in both a Webapp (browser) or Node.js by importing cross-fetch:
// import fetch from "cross-fetch";
(async () => {
const res = await fetch(
"https://api.sequence.build/rpc/Analytics/MarketTxnEventTotal",
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
filter: {
projectId: 4859,
startDate: "2024-01-23",
endDate: "2024-05-23",
dateInterval: "DAY"
}
})
}
);
console.log("res", await res.json());
})();
Time Interval
curl 'https://api.sequence.build/rpc/Analytics/MarketTxnEventDaily' \
-H 'accept: */*' \
-H 'authorization: BEARER <SECRET_API_ACCESS_KEY>' \
-H 'content-type: application/json' \
--data-raw '{"filter":{"projectId":<PROJECT_ID>,"startDate":"2024-04-23","endDate":"2024-05-23", "dateInterval":"DAY"}}'
// Works in both a Webapp (browser) or Node.js by importing cross-fetch:
// import fetch from "cross-fetch";
(async () => {
const res = await fetch(
"https://api.sequence.build/rpc/Analytics/MarketTxnEventDaily",
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
filter: {
projectId: 4859,
startDate: "2024-01-23",
endDate: "2024-05-23",
dateInterval: "DAY"
}
})
}
);
console.log("res", await res.json());
})();
Fetch Wallets on your Marketplace
Fetch wallets that have interacted with your marketplace - either by total across all time or broken down by days, weeks or months.
Total
curl 'https://api.sequence.build/rpc/Analytics/MarketWalletsTotal' \
-H 'accept: */*' \
-H 'authorization: BEARER <SECRET_API_ACCESS_KEY>' \
-H 'content-type: application/json' \
--data-raw '{"filter":{"projectId":<PROJECT_ID>,"startDate":"2024-04-23","endDate":"2024-05-23"}}'
// Works in both a Webapp (browser) or Node.js by importing cross-fetch:
// import fetch from "cross-fetch";
(async () => {
const res = await fetch("https://api.sequence.build/rpc/Analytics/MarketWalletsTotal", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
filter: {
projectId: 4859,
startDate: "2024-01-23",
endDate: "2024-05-23",
dateInterval: "DAY"
}
})
});
console.log("res", await res.json());
})();
Time Interval
curl 'https://api.sequence.build/rpc/Analytics/MarketWalletsDaily' \
-H 'accept: */*' \
-H 'authorization: BEARER <SECRET_API_ACCESS_KEY>' \
-H 'content-type: application/json' \
--data-raw '{"filter":{"projectId":<PROJECT_ID>,"startDate":"2024-04-23","endDate":"2024-05-23", "dateInterval":"DAY"}}'
// Works in both a Webapp (browser) or Node.js by importing cross-fetch:
// import fetch from "cross-fetch";
(async () => {
const res = await fetch("https://api.sequence.build/rpc/Analytics/MarketWalletsDaily", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
filter: {
projectId: 4859,
startDate: "2024-01-23",
endDate: "2024-05-23",
dateInterval: "DAY"
}
})
});
console.log("res", await res.json());
})();
Schema
All wallet analytic endpoints follow a similar request schema
- Request: POST
- Content-Type: application/json
- Body (in JSON):
projectId (uint64) — projectID of your project, can be found in the URL of the Builder project.
startDate (timestamp) — starting date of the query in YYYY—MM—DD format
endDate (timestamp) — ending date of the query in YYYY—MM—DD format
dateInterval (OPTIONAL string) — date interval for the query, options are “DAY”, “WEEK”, or “MONTH”
- Response (in JSON):
marketStats (marketStats[])
[
value
buyItems (uint64) — number of items bought.
sellItems (uint64) — number of items sold
label (string) — label associated with the corresponding endpoint
]