circle-plusCreate a Market

Creates a new prediction market on PredictBase. A market creation fee of 1 USDC is automatically deducted from the creator’s PredictBase balance when the transaction is submitted.


Endpoint

POST /create-market-for-user

Full URL

https://api.predictbase.app/create-market-for-user

Authentication

This endpoint requires authentication. You must include your API key in the request headers:

x-api-key: YOUR_API_KEY

The API key must be authorized for the creator address.


Request Body

{
  "creator": "0xCreatorAddress",
  "question": "Will BTC be above $100k by 2026?",
  "optionTitles": ["Yes", "No"],
  "optionImages": ["", ""],
  "categories": ["Crypto", "BTC"],
  "details": "Longer description / rules",
  "image": "https://.../market-hero.png",
  "endDate": "1735689600",
}

Field Notes

  • creator Wallet address that will own and manage the market

  • endDate Unix timestamp in seconds (uint64, string or number)

  • optionTitles Titles for each market option (e.g. ["Yes", "No"])

  • optionImages (Optional) Image URLs for each option. This field is not implemented yet and is currently ignored if provided.


Response (Success)


Pending Receipt


⚠️ Failure Cases

  • Missing or invalid x-api-key

  • API key not authorized for the creator

  • Insufficient balance to cover the 1 USDC market creation fee

  • Invalid market parameters

  • On-chain transaction failure

Last updated