POST
/
api
/
v1
/
suppliers
/
data
/
count
Get Record Count
curl --request POST \
  --url https://api.example.com/api/v1/suppliers/data/count \
  --header 'Content-Type: application/json' \
  --data '
{
  "supplier_name": "<string>",
  "fee_type": "<string>",
  "fee_category": "<string>",
  "action": "<string>",
  "participant": "<string>",
  "start_date": "<string>",
  "end_date": "<string>"
}
'
{
  "error": "Bad Request",
  "message": "Invalid parameter value",
  "details": {
    "field": "fee_type",
    "provided": "invalid_type",
    "allowed": ["option", "equity"]
  }
}

Overview

This endpoint returns the total count of records available based on your filter criteria without retrieving the actual data. Use this before fetching data to know how many records match your filters and plan pagination accordingly.
Authorization Required - You must include a valid Bearer token in the Authorization header. Contact sales@rulebook.company to obtain API access.

Request Body

supplier_name
string
required
Name or code of the supplier (e.g., NYSE, NASDAQ, CBOE)
fee_type
string
required
Type of fee to retrieve
  • option - Options trading fees
  • equity - Equity trading fees
fee_category
string
required
Category of fees to retrieve
  • Fee And Rebates
  • Legal Regulatory Fees
  • Market Data Fees
  • Participant Fee
  • Port Fees And Other Services
action
string
required
Trading action type
  • Make - Liquidity providing orders
  • Take - Liquidity taking orders
  • Open - Opening transactions
  • Routed & Other - Routed orders and other actions
participant
string
required
Participant type for the data
  • All - All participant types
  • Away Market Maker - Market makers from other exchanges
  • Market Maker - Exchange market makers
  • Broker Dealer - Broker-dealer firms
  • Customer - Retail and institutional customers
  • Firm - Proprietary trading firms
  • Professional & Other - Professional traders and other categories
start_date
string
Start date for data retrieval (ISO 8601 format: YYYY-MM-DD)
end_date
string
End date for data retrieval (ISO 8601 format: YYYY-MM-DD)

Request Example

curl -X POST https://api.rulebook.company/v1/suppliers/data/count \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "supplier_name": "NYSE",
    "fee_type": "equity",
    "fee_category": "Fee And Rebates",
    "action": "Make",
    "participant": "Market Maker",
    "start_date": "2024-01-01",
    "end_date": "2024-12-31"
  }'

Response

success
boolean
Indicates if the request was successful
data
object
Container for the response data

Example Response

{
  "success": true,
  "data": {
    "supplier": "NYSE",
    "fee_type": "equity",
    "fee_category": "Fee And Rebates",
    "action": "Make",
    "participant": "Market Maker",
    "date_range": {
      "start": "2024-01-01T00:00:00Z",
      "end": "2024-12-31T23:59:59Z"
    },
    "total_count": 365,
    "pagination_info": {
      "max_records_per_request": 100,
      "total_pages": 4
    }
  }
}

Usage Pattern

1

Get Total Count

First, call this endpoint to get the total number of records
POST /api/v1/suppliers/data/count
# Response: { "total_count": 365, "total_pages": 4 }
2

Fetch Data in Batches

Then, fetch data in batches using pagination
POST /api/v1/suppliers/data
# With offset: 0, limit: 100 (records 1-100)
# With offset: 100, limit: 100 (records 101-200)
# With offset: 200, limit: 100 (records 201-300)
# With offset: 300, limit: 100 (records 301-365)

Error Responses

{
  "error": "Bad Request",
  "message": "Invalid parameter value",
  "details": {
    "field": "fee_type",
    "provided": "invalid_type",
    "allowed": ["option", "equity"]
  }
}
Use this endpoint before fetching data to understand how many API calls you’ll need to retrieve all records.