> ## Documentation Index
> Fetch the complete documentation index at: https://motiontrade.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Attribution

> Entity impact and causality analysis endpoints

## Entity Attribution

<ParamField path="GET" method="/api/attribution/entity/:slug">
  Get impact coefficients showing how an entity's attribute changes affect market prices.
</ParamField>

### Path Parameters

<ParamField path="slug" type="string" required>
  Entity slug (e.g., `patrick-mahomes`)
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "entitySlug": "patrick-mahomes",
  "coefficients": [
    {
      "marketId": "market-uuid",
      "marketTitle": "Chiefs to win Super Bowl",
      "attribute": "injury_status",
      "coefficient": -0.15,
      "significance": 0.95
    }
  ],
  "count": 5
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/entity/patrick-mahomes"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.marketmotion.xyz/api/attribution/entity/patrick-mahomes'
  );
  const { coefficients } = await response.json();
  ```
</CodeGroup>

***

## Market Attribution

<ParamField path="GET" method="/api/attribution/market/:venue/:marketId">
  Get entity attributions for a specific market — which entities most influence its price.
</ParamField>

### Path Parameters

<ParamField path="venue" type="string" required>
  Venue: `polymarket`, `kalshi`
</ParamField>

<ParamField path="marketId" type="string" required>
  Market ID
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "venue": "polymarket",
  "marketId": "market-uuid",
  "entities": [
    {
      "slug": "patrick-mahomes",
      "displayName": "Patrick Mahomes",
      "coefficient": -0.15,
      "attribute": "injury_status"
    }
  ],
  "count": 3
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/market/polymarket/market-uuid"
  ```
</CodeGroup>

***

## Top Movers

<ParamField path="GET" method="/api/attribution/top-movers">
  Get entities with the largest recent market impact.
</ParamField>

### Query Parameters

<ParamField query="hours" type="number">
  Lookback window in hours
</ParamField>

<ParamField query="limit" type="number">
  Maximum results
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "movers": [
    {
      "entitySlug": "patrick-mahomes",
      "displayName": "Patrick Mahomes",
      "attributeChanged": "injury_status",
      "marketImpact": 0.15,
      "affectedMarkets": 5
    }
  ],
  "count": 10
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/top-movers?hours=24&limit=10"
  ```
</CodeGroup>

***

## Predict Impact

<ParamField path="GET" method="/api/attribution/predict">
  Predict the market impact of a hypothetical attribute change.
</ParamField>

### Query Parameters

<ParamField query="entity" type="string" required>
  Entity slug
</ParamField>

<ParamField query="attribute" type="string" required>
  Attribute key (e.g., `injury_status`)
</ParamField>

<ParamField query="value" type="string" required>
  Hypothetical new value (e.g., `out`)
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "entity": "patrick-mahomes",
  "attribute": "injury_status",
  "predictions": [
    {
      "marketId": "market-uuid",
      "marketTitle": "Chiefs to win Super Bowl",
      "currentPrice": 0.35,
      "predictedPrice": 0.20,
      "priceChange": -0.15
    }
  ],
  "count": 5
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/predict?entity=patrick-mahomes&attribute=injury_status&value=out"
  ```
</CodeGroup>

***

## Causality

<ParamField path="GET" method="/api/attribution/causality/:slug">
  Get causal relationships for an entity — which other entities it influences and is influenced by.
</ParamField>

### Path Parameters

<ParamField path="slug" type="string" required>
  Entity slug
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "entitySlug": "patrick-mahomes",
  "causality": [
    {
      "targetEntity": "kansas-city-chiefs",
      "direction": "causes",
      "strength": 0.85,
      "mechanism": "player_performance"
    }
  ],
  "count": 3
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/causality/patrick-mahomes"
  ```
</CodeGroup>

***

## Top Causal

<ParamField path="GET" method="/api/attribution/top-causal">
  Get entities with the strongest causal influence across the graph.
</ParamField>

### Query Parameters

<ParamField query="limit" type="number">
  Maximum results
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "results": [
    {
      "entitySlug": "jerome-powell",
      "displayName": "Jerome Powell",
      "causalStrength": 0.92,
      "affectedEntities": 15,
      "affectedMarkets": 45
    }
  ],
  "count": 10
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.marketmotion.xyz/api/attribution/top-causal?limit=10"
  ```
</CodeGroup>
