Quick Start

Welcome to the Xmarket API documentation. This guide will help you get started with integrating the Xmarket trading API into your applications.

Overview

The Xmarket API provides programmatic access to:

  • Real-time orderbook data

  • Order creation and management

  • Market information

  • Trading operations

Prerequisites

Before you begin, you'll need:

  1. An Xmarket account

  2. An API key for authentication

Getting Your API Key

Step 1: Register an Account

Visit Xmarket and create your account if you haven't already.

Step 2: Generate API Key

  1. Navigate to your account Settings page

  2. Find the API Management section

  3. Click Generate New API Key

  4. Store your API key securely - you won't be able to see it again!

Important: Keep your API key secure and never share it publicly or commit it to version control.

Authentication

All API requests require authentication using your API key in the x-api-key header:

x-api-key: YOUR_API_KEY

Making Your First Request

Let's start with a simple request to fetch orderbook data:

curl -X GET \
  'https://engine.xmarket.app/api/v1/orderbook/{outcomeId}' \
  -H 'x-api-key: YOUR_API_KEY'

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

Status Code
Description

200

Success

201

Resource created

400

Bad Request - Invalid parameters

401

Unauthorized - Invalid or missing API key

404

Not Found - Resource doesn't exist

500

Internal Server Error

Error responses include a message explaining what went wrong:

{
  "message": "Invalid market ID"
}

Rate Limits

To ensure fair usage and system stability, the API implements rate limiting:

  • Default limit: 100 requests per minute per API key

When you exceed the rate limit, you'll receive a 429 Too Many Requests response.

Next Steps

Now that you're set up, explore our detailed API documentation:

Support

If you encounter any issues or have questions:

  • Check our FAQs

  • Contact support through the platform

Last updated

Was this helpful?