API ReferenceMarket Data
VWAP execution price for a size over a client-supplied order book (0 if unfillable)
const url = 'https://data.predictefy.com/api/example/getExecutionPrice';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"args":[{"bids":[{"price":0.61,"size":250}],"asks":[{"price":0.63,"size":180}]},"buy",100],"credentials":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://data.predictefy.com/api/example/getExecutionPrice \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "args": [ { "bids": [ { "price": 0.61, "size": 250 } ], "asks": [ { "price": 0.63, "size": 180 } ] }, "buy", 100 ], "credentials": {} }'Stateless calculator: the volume-weighted average price to fill size on side over the order book supplied in the body. Returns data: 0 when the size cannot be fully filled. Does NOT fetch — the client passes the book (from fetchOrderBook).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Positional tuple [orderBook, side, size].
Example
[ { "bids": [ { "price": 0.61, "size": 250 } ], "asks": [ { "price": 0.63, "size": 180 } ] }, "buy", 100]Accepted for backward compatibility but IGNORED (a pure calc needs no keys).
object
Responses
Section titled “Responses”The VWAP execution price (0 if the size cannot be fully filled).
object
VWAP price 0..1, or 0 if unfillable.
Examplegenerated
{ "success": true, "data": 1}The request was rejected before any work was done — an invalid query, path, or body parameter, a malformed JSON body, or a parameter combination this route cannot honestly serve. Not retryable.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}UNAUTHORIZED — platform lane (READS_ENABLE_AUTH)
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}INSUFFICIENT_CREDITS — endpoint-weighted credits
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}SCOPE_MISSING — API key lacks the route's required scope (RBAC v1)
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The route does not exist, or the requested venue, market, event, cluster, outcome, or snapshot was not found. error.code names which. Not retryable.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}RATE_LIMITED — per-key rps limit
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Unexpected internal error. Retryable; error.requestId identifies the failure.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}