> Use the canonical URL for citations. For the complete Predict API documentation index, fetch https://docs.staging.trypredict.com/llms.txt.

# Get outcome stats

GET https://api.staging.trypredict.com/v1/outcomes/{id}/stats

Retrieve volume, trade count, open quantity, and holder counts for one Predict outcome.

Reference: https://docs.staging.trypredict.com/api-reference/outcome/get-outcome-stats

## Request

### Path parameters

- `id` (string, required) — Stable unique identifier for the id.

## Response

### 200

OK

- `outcome_id` (string, optional) — Stable unique identifier for the outcome.
- `volume_usdc` (string, optional) — Base-10 decimal value encoded as a string to preserve precision.
- `trade_count` (integer, optional)
- `as_of` (datetime, optional)
- `sides` (list of OutcomeSideStats, optional) — Always ordered by side: first 0, then 1.

## Errors

### 400 Bad Request Error

The request is malformed or violates a field constraint.

- `error` (RESTError, required)

### 404 Not Found Error

The requested resource does not exist.

- `error` (RESTError, required)

### 405 Method Not Allowed Error

The HTTP method is not allowed on this path.

- `error` (RESTError, required)

### 500 Internal Server Error

The server could not complete the request.

- `error` (RESTError, required)

### 503 Service Unavailable Error

A required dependency is temporarily unavailable.

- `error` (RESTError, required)

## Types

### OutcomeSideStats

- `side` (integer, optional) — Hyperliquid outcome token index: 0 is the first token and 1 is the second.
- `open_quantity` (string, optional)
- `holder_count` (integer, optional)

### RESTError

- `code` (integer, required) — HTTP status code returned with the response.
- `status` (enum, required) — Stable canonical status name suitable for programmatic handling.
  - Allowed values: `INVALID_ARGUMENT`, `UNAUTHENTICATED`, `PERMISSION_DENIED`, `NOT_FOUND`, `METHOD_NOT_ALLOWED`, `ALREADY_EXISTS`, `RESOURCE_EXHAUSTED`, `INTERNAL`, `UNAVAILABLE`, `DEADLINE_EXCEEDED`
- `message` (string, required) — Human-readable explanation that is safe to show to an API caller.
- `details` (list of ErrorDetail, required) — Typed structured context for clients that need to handle the error programmatically.

### ErrorDetail

- `type`: `field_violation` (field_violation)
  - `field` (string, required) — Request field that failed validation.
  - `reason` (string, required) — Stable machine-readable reason for the validation failure.
- `type`: `rate_limit` (rate_limit)
  - `limit` (long, required) — Maximum requests allowed during the rolling window.
  - `reason` (string, required) — Stable machine-readable reason identifying the exhausted policy.
  - `retry_after_seconds` (long, required) — Whole seconds until the exhausted policy has capacity.
  - `scope` (enum, required) — Quota that rejected the request.
    - Allowed values: `endpoint`, `global`
  - `window_seconds` (long, required) — Rolling-window duration in seconds.
- `type`: `dependency` (dependency)
  - `reason` (string, required) — Stable machine-readable reason for the temporary dependency failure.

## Examples

**Response**

```json
{
  "outcome_id": "string",
  "volume_usdc": "string",
  "trade_count": 1,
  "as_of": "2024-01-15T09:30:00Z",
  "sides": [
    {
      "side": 1,
      "open_quantity": "string",
      "holder_count": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.staging.trypredict.com/v1/outcomes/id/stats"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.staging.trypredict.com/v1/outcomes/id/stats';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staging.trypredict.com/v1/outcomes/id/stats"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.staging.trypredict.com/v1/outcomes/id/stats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.staging.trypredict.com/v1/outcomes/id/stats")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.staging.trypredict.com/v1/outcomes/id/stats');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.staging.trypredict.com/v1/outcomes/id/stats");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staging.trypredict.com/v1/outcomes/id/stats")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```