Pacifica
  • Closed Beta Guide
  • Trading on Pacifica
    • Overview
    • Contract Specifications
      • Oracle Price & Mark Price
    • Order Types
    • Order Options
    • Margin & Leverage
    • Funding Rates
    • Trading Fees
    • Liquidations
    • Deposits & Withdrawals
  • API Documentation
    • API
      • REST API
        • Markets
          • Get market info
          • Get prices
          • Get kline (candle) data
          • Get recent trades
        • Account
          • Get account info
          • Get account settings
          • Update leverage
          • Update margin mode
          • Get positions
          • Get trade history
          • Get funding history
          • Get account equity history
          • Request withdrawal
        • Subaccounts
          • Create subaccount
          • Subaccount fund transfer
        • Orders
          • Get open orders
          • Get order history
          • Get order history by ID
          • Create order
          • Create stop order
          • Create position TP/SL
          • Cancel order
          • Cancel all orders
          • Cancel stop order
          • Batch order
      • Websocket
        • Subscriptions
          • Prices
          • Orderbook
          • Trades
          • Candle
          • Account balance
          • Account margin
          • Account leverage
          • Account positions
          • Account orders
          • Account order updates
          • Account trades
        • Trading operations
          • Create order
          • Cancel order
          • Cancel all orders
      • Signing
        • Implementation
        • Operation Types
        • Error Handling
        • Hardware Wallet
      • Rate limits
        • API-key rate limiting
      • Tick and lot size
    • Specification
  • Other
    • Audits
    • Brand Assets
    • Contact Us
    • Glossary of Terms
Powered by GitBook
On this page
  1. API Documentation
  2. API
  3. Rate limits

API-key rate limiting

The following guide covers the creation and usage of Pacifica API-keys.

Pacifica also offers API-key rate limiting on websocket API that allows for more flexible limits. For more information around API-key limits, please reach out to us in the Discord API channel. API-keys are generated via REST API. Each account can have up to five API keys.

POST /api/v1/orders/create

Request Body:

Field
Type
Need
Description
Example

"account"

string

required

User's wallet address

42trU9A5...

"signature"

string

required

Cryptographic signature

5j1Vy9Uq...

"timestamp"

integer

required

Current timestamp in milliseconds

1716200000000

{
    "auth": {
      "account": "42trU9A5...",
      "signature": "5j1Vy9Uq...",
      "timestamp": 1716200000000
    }
}

Response

{
  "data": {
    "api_key": "AbCdEfGh_2mT8x..."
  }
}

Note: API keys are generated with a prefix for fast lookup Format: "{8_char_prefix}_{base58_encoded_uuid}"

Using a Pacifica API-key

Pacifica's API keys are used to enhance websocket rate-limiting. The default rate for an API key follows the same restrictions as IP-based rate limits. Pacifica API-keys are used in the websocket connection header to specify API-key rate limiting. Connection Request Example:

GET /ws HTTP/1.1
Host: ws.pacifica.fi
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
PF-API-KEY: your_api_key_here
PreviousRate limitsNextTick and lot size

Last updated 8 hours ago