Markets
Overview
The Markets API provides endpoints for interacting with Ethos prediction markets. This includes searching markets, retrieving market details, viewing price and transaction history, checking holders, tracking activity, and accessing leaderboards.
Endpoints
Search Markets
Description: Search for markets using a query string or retrieve all markets if no query is provided.
Authentication Required: No
Parameters
Query Parameters
q
string
No
Query string to search for markets (minimum 2 characters)
limit
integer
No
Maximum number of results to return (default: 50)
Responses
Success Response
Code: 200 OK
ok
boolean
Success status
data
array
Array of market objects
data[].marketProfileId
integer
Unique identifier for the market
data[].creatorAddress
string
Ethereum address of the market creator
data[].positivePrice
string
Current positive price in wei
data[].negativePrice
string
Current negative price in wei
data[].trustVotes
integer
Number of trust votes
data[].distrustVotes
integer
Number of distrust votes
data[].createdAt
string
Creation timestamp (ISO 8601 format)
data[].updatedAt
string
Last update timestamp (ISO 8601 format)
data[].basePrice
string
Base price in wei
data[].creationCost
string
Creation cost in wei
data[].liquidity
string
Liquidity parameter
data[].configType
string
Market configuration type (VOLATILE, NORMAL, or INSULATED)
data[].profile
object
Market profile information
data[].profile.primaryAddress
string
Primary Ethereum address of the profile
data[].profile.avatarUrl
string
URL to the profile's avatar image
data[].profile.ethosScore
integer
Ethos reputation score
data[].profile.name
string
Display name
data[].profile.twitterUsername
string or null
Twitter username, if available
data[].stats
object
Market statistics
data[].stats.marketCapWei
string
Market capitalization in wei
data[].stats.volumeTotalWei
string
Total trading volume in wei
data[].stats.volume24hWei
string
24-hour trading volume in wei
data[].stats.priceChange24hPercent
integer
24-hour price change percentage
Error Response
Code: 400 Bad Request
Example
Request
Response
Notes
If no query (
q
) parameter is provided, the endpoint will return all markets.The search matches against market profile names, Twitter usernames, and other profile information.
The query parameter must contain at least 2 characters for a valid search.
The default limit is 50 markets, but this can be customized using the
limit
parameter.Market configuration types include: VOLATILE (highest risk/reward), NORMAL (balanced), and INSULATED (lowest risk/reward).
All price values are returned as strings to preserve precision for large numbers.
Get Bulk Market Info by Profile IDs
Description: Retrieves detailed market information for multiple markets based on their associated profile IDs.
Authentication Required: No
Parameters
Request Body
profileIds
array of numbers
Yes
Array of profile IDs for the markets to retrieve.
Responses
Success Response
Code: 200 OK
Returns an array of market objects, with the same structure as the objects returned by the GET /api/v1/markets/search
endpoint.
(See GET /api/v1/markets/search
documentation for detailed field descriptions of the market object.)
Error Response
Code: 400 Bad Request (Example: Invalid input)
Code: 500 Internal Server Error (Example: Profile data not found for a market)
Example
Request
Notes
This endpoint is useful for fetching data for a specific set of markets when their profile IDs are known.
If any requested
profileId
does not correspond to an existing market or its associated profile cannot be found, the request may fail with a 500 error.
Get Market News
Description: Retrieves recent popular tweets from the Twitter accounts associated (via attestation) with the given market profile IDs. This is used to show relevant recent social activity for markets.
Authentication Required: No
Parameters
Request Body
Expects a raw JSON array of profile IDs.
array of numbers
Yes
Array of profile IDs for the markets to retrieve associated tweets for.
Responses
Success Response
Code: 200 OK
Returns an array of objects, each mapping a marketProfileId
to a tweet
object (or null
if no relevant tweet was found/cached).
ok
boolean
Success status
data
array
Array of market news objects
data[].marketProfileId
number
The profile ID of the market
data[].tweet
object | null
The associated tweet object, or null
if none found/applicable
data[].tweet.id
string
The ID of the tweet
data[].tweet.text
string
The text content of the tweet
data[].tweet.createdAt
string
ISO 8601 timestamp when the tweet was created
data[].tweet.url
string
URL to the tweet on X.com
data[].tweet.retweets
number
Number of retweets
data[].tweet.likes
number
Number of likes
data[].tweet.replies
number
Number of replies
data[].tweet.impressions
number
Number of impressions
Error Response
Code: 400 Bad Request (Example: Invalid input type)
Example
Request
Notes
This endpoint finds the Twitter account associated with each market's profile ID via X attestations.
It then attempts to retrieve a recent, popular tweet from that user's timeline.
Tweet data is cached for performance (currently 24 hours). If no suitable tweet is found in the cache or via a fresh fetch,
null
will be returned for that market'stweet
field.The selection criteria for "popular" tweets are based on an internal scoring mechanism considering retweets, replies, likes, and impressions.
Get Market by Profile ID
Description: Retrieves detailed market information for a specific market based on its associated profile ID.
Authentication Required: No
Parameters
Path Parameters
profileId
integer
Yes
Profile ID of the market to retrieve.
Responses
Success Response
Code: 200 OK
Returns a market object, with the same structure as the objects returned by the GET /api/v1/markets/search
endpoint.
(See GET /api/v1/markets/search
documentation for detailed field descriptions of the market object.)
Error Response
Code: 404 Not Found (Example: Market not found)
Example
Request
Notes
This endpoint is useful for fetching detailed data for a specific market when its profile ID is known.
If the requested
profileId
does not correspond to an existing market, the request will fail with a 404 error.
Get Market Price History
Description: Retrieves the price history for a specific market based on its associated profile ID.
Authentication Required: No
Parameters
Path Parameters
profileId
integer
Yes
Profile ID of the market to retrieve price history for.
Responses
Success Response
Code: 200 OK
Returns an array of price history objects, each containing the timestamp and price in wei. Returns an array of price event objects, each containing the positive/negative price and the creation timestamp.
ok
boolean
Success status
data
array
Array of price history objects
data[].timestamp
string
Timestamp of the price data point (ISO 8601 format)
data[].priceWei
string
Price in wei at the given timestamp
data[].positivePrice
string
Positive price in wei at this event time
data[].negativePrice
string
Negative price in wei at this event time
data[].createdAt
string
Timestamp of the price change event (ISO 8601 format)
Error Response
Code: 404 Not Found (Example: Market not found)
Example
Request
Notes
This endpoint is useful for fetching price history data for a specific market when its profile ID is known.
If the requested
profileId
does not correspond to an existing market, the request will fail with a 404 error.The price history data is sorted by timestamp in ascending order.
The data reflects recorded price change events, not necessarily sampled at regular intervals.
Get Market Transaction History
Description: Retrieves the transaction history for a specific market based on its associated profile ID.
Authentication Required: No
Parameters
Path Parameters
profileId
integer
Yes
Profile ID of the market to retrieve transaction history for.
Responses
Success Response
Code: 200 OK
Returns an array of transaction history objects, each containing the transaction hash, timestamp, type, and amount. Returns a paginated list of transaction history objects for the specified market.
ok
boolean
Success status
data
array
Array of transaction history objects
data[].txHash
string
Transaction hash
data[].timestamp
string
Timestamp of the transaction (ISO 8601 format)
data[].type
string
Transaction type (BUY or SELL)
data[].amountWei
string
Transaction amount in wei
data
object
Paginated response object
data.values
array
Array of transaction history objects
data.values[].eventId
integer
Unique identifier for the event
data.values[].marketId
integer
Profile ID of the market
data.values[].actorAddress
string
Ethereum address of the actor performing the transaction
data.values[].type
string
Transaction type (BUY or SELL)
data.values[].voteType
string
Type of vote (trust or distrust)
data.values[].votes
integer
Number of votes involved in the transaction
data.values[].funds
string
Transaction amount in wei
data.values[].txHash
string
Transaction hash
data.values[].timestamp
integer
Timestamp of the transaction (Unix timestamp)
data.total
integer
Total number of transactions available
data.limit
integer
Maximum number of transactions returned in this response
data.offset
integer
Number of transactions skipped (for pagination)
Error Response
Code: 404 Not Found (Example: Market not found)
Example
Request
Notes
This endpoint is useful for fetching transaction history data for a specific market when its profile ID is known.
If the requested
profileId
does not correspond to an existing market, the request will fail with a 404 error.The transaction history data is sorted by timestamp in descending order.
Pagination parameters (
limit
,offset
) can be added as query parameters (e.g.,?limit=10&offset=20
). The default limit is likely 50, offset 0.A
voteTypeFilter
query parameter can be used to filter by 'trust' or 'distrust'.
Get Market Holders
Description: Retrieves the holders for a specific market based on its associated profile ID.
Authentication Required: No
Parameters
Path Parameters
profileId
integer
Yes
Profile ID of the market to retrieve holders for.
Responses
Success Response
Code: 200 OK
Returns an array of holder objects, each containing the Ethereum address and balance in wei. Returns an object containing an array of holder objects, detailing their address, vote type, and total votes/shares.
ok
boolean
Success status
data
array
Array of holder objects
data[].address
string
Ethereum address of the holder
data[].balanceWei
string
Balance of the holder in wei
data
object
Response data container
data.all
array
Array of holder objects
data.all[].actorAddress
string
Ethereum address of the holder
data.all[].isPositive
boolean
Whether the holder's position is based on trust (true) or distrust (false) votes
data.all[].total_amount
string
Total amount of votes/shares held (BigInt string format)
data.all[].marketId
integer
Profile ID of the market
data.all[].voteType
string
Type of vote (trust or distrust)
data.all[].total
string
Total amount of votes/shares held (BigInt string format, possibly redundant)
Error Response
Code: 404 Not Found (Example: Market not found)
Example
Request
Notes
This endpoint is useful for fetching holder data for a specific market when its profile ID is known.
If the requested
profileId
does not correspond to an existing market, the request will fail with a 404 error.The holder data is sorted by balance in descending order.
The holder data appears to be sorted by the total amount held, in descending order.
The
total_amount
andtotal
fields use a string representation ending in 'n', indicating BigInt values.
Get Address Market Activity
Description: Retrieves the market activity for a specific Ethereum address.
Authentication Required: No
Parameters
Path Parameters
address
string
Yes
Ethereum address to retrieve market activity for.
Responses
Success Response
Code: 200 OK
Returns an array of market activity objects, each containing the market profile ID, transaction hash, timestamp, type, and amount. Returns a paginated list of market activity (transaction) objects for the specified address.
ok
boolean
Success status
data
array
Array of market activity objects
data[].marketProfileId
integer
Profile ID of the market
data[].txHash
string
Transaction hash
data[].timestamp
string
Timestamp of the transaction (ISO 8601 format)
data[].type
string
Transaction type (BUY or SELL)
data[].amountWei
string
Transaction amount in wei
data
object
Paginated response object
data.values
array
Array of transaction history objects
data.values[].eventId
integer
Unique identifier for the event
data.values[].marketId
integer
Profile ID of the market involved in the transaction
data.values[].actorAddress
string
Ethereum address of the actor (matches the path parameter)
data.values[].type
string
Transaction type (BUY or SELL)
data.values[].voteType
string
Type of vote (trust or distrust)
data.values[].votes
integer
Number of votes involved in the transaction
data.values[].funds
string
Transaction amount in wei
data.values[].txHash
string
Transaction hash
data.values[].timestamp
integer
Timestamp of the transaction (Unix timestamp)
data.total
integer
Total number of transactions available for this address
data.limit
integer
Maximum number of transactions returned in this response
data.offset
integer
Number of transactions skipped (for pagination)
Error Response
Code: 400 Bad Request (Example: Invalid address)
Example
Request
Notes
This endpoint is useful for fetching market activity data for a specific Ethereum address.
If the requested
address
is not a valid Ethereum address, the request will fail with a 400 error.The market activity data is sorted by timestamp in descending order.
Pagination parameters (
limit
,offset
) can be added as query parameters (e.g.,?limit=10&offset=20
). The default limit is likely 50, offset 0.A
voteTypeFilter
query parameter can likely be used to filter by 'trust' or 'distrust' (similar to the market tx history endpoint).
Get Address Market Holdings
Description: Retrieves the market holdings for a specific Ethereum address.
Authentication Required: No
Parameters
Path Parameters
address
string
Yes
Ethereum address to retrieve market holdings for.
Responses
Success Response
Code: 200 OK
Returns an array of market holding objects, each containing the market profile ID, balance in wei, and market information.
ok
boolean
Success status
data
array
Array of market holding objects
data[].marketProfileId
integer
Profile ID of the market
data[].balanceWei
string
Balance of the holder in wei
data[].market
object
Market information
Error Response
Code: 400 Bad Request (Example: Invalid address)
Example
Request
Notes
This endpoint is useful for fetching market holding data for a specific Ethereum address.
If the requested
address
is not a valid Ethereum address, the request will fail with a 400 error.The market holding data is sorted by balance in descending order.
Get Address Market Holdings Total Value
Description: Retrieves the total value of all market holdings for a specific user address.
Authentication Required: No
Parameters
Path Parameters
address
string
Yes
The user's wallet address.
Query Parameters
None
Request Body
None
Responses
Success Response
Code: 200 OK
ok
boolean
Indicates if the request was successful.
data
object
Container for the response data.
data.totalValue
string
The current total value (in wei, as string ending in 'n') of all holdings.
Error Responses
Code: 400 Bad Request
Code: 404 Not Found (Potentially, if address not found, though might return 0)
Example
Request
Response
Notes
Authentication is not required.
BigInt value is returned as a string ending in 'n'.
If the address has no holdings, the value returned is "0n".
Get Address Market Volume
Description: Retrieves the total market volume for a specific Ethereum address.
Authentication Required: No
Parameters
Path Parameters
address
string
Yes
Ethereum address to retrieve market volume for.
Responses
Success Response
Code: 200 OK
Returns an object containing the total market volume in wei.
ok
boolean
Success status
data
object
Object containing the total market volume
data.totalVolumeWei
string
Total market volume in wei
Error Response
Code: 400 Bad Request (Example: Invalid address)
Example
Request
Notes
This endpoint is useful for fetching market volume data for a specific Ethereum address.
If the requested
address
is not a valid Ethereum address, the request will fail with a 400 error.
Get XP Leaderboard
Description: Retrieves a leaderboard of users ranked by their XP in the markets.
Authentication Required: No
Parameters
Query Parameters
limit
number
No
50
Maximum number of users to return (max 100).
Responses
Success Response
Code: 200 OK
Note: This endpoint returns a simple array, not a paginated object.
Error Responses
Code: 400 Bad Request (Example: Invalid limit)
Example
Request
Response
Notes
Retrieves an XP-based leaderboard for market participants, ranked highest XP first.
Only the
limit
query parameter is supported (max 100).Returns a simple array containing
xp
(string) andaddress
.
Get Profit Leaderboard
Description: Retrieves a leaderboard of users ranked by their profit in the markets.
Authentication Required: No
Parameters
Query Parameters
limit
number
No
50
Maximum number of users to return (max 100).
Responses
Success Response
Code: 200 OK
Note: This endpoint returns a simple array, not a paginated object.
Error Responses
Code: 400 Bad Request (Example: Invalid limit)
Example
Request
Response
Notes
Retrieves a profit-based leaderboard for market participants, ranked highest profit first.
Only the
limit
query parameter is supported (max 100).Returns a simple array containing
profit
(string) andaddress
.
Last updated