> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getoutprice.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getoutprice.com/_mcp/server.

# Item History

GET https://getoutprice.com/v1/tracked-items/{item_id}/history

Chart-ready price history: the series, our own price, stock gaps and the
statistics.

Distinct from `/snapshots`, which returns rows. This returns a *reading* of
those rows — what it usually costs, whether today is cheap by its own
standards, when it was unavailable — because that is the question a chart
gets opened to answer, and computing it in the browser would mean every
client reimplementing the held-reading rule and getting it subtly wrong.

Reference: https://docs.getoutprice.com/api-reference/tracked-items/item-history

## Authentication

- `X-API-Key` header (required) — Your Outprice API key (starts with pw_).

## Request

### Path parameters

- `item_id` (integer, required)

### Query parameters

- `days` (integer, optional, default: 90)

## Response

### 200

Successful Response

- `item_id` (integer, required)
- `days` (integer, required)
- `title` (string, optional, nullable)
- `currency` (string, optional, nullable)
- `points` (list of HistoryPoint, optional)
- `own` (list of HistoryPoint, optional)
- `out_of_stock` (list of HistorySpan, optional)
- `stats` (HistoryStats, optional)
- `downsampled` (boolean, optional, default: false)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### HistoryPoint

- `at` (datetime, required)
- `price` (double, optional, nullable)
- `in_stock` (boolean, optional, nullable)
- `held` (boolean, optional, default: false)

### HistorySpan

- `start` (datetime, required)
- `end` (datetime, required)
- `hours` (double, required)

### HistoryStats

- `low` (double, optional, nullable)
- `high` (double, optional, nullable)
- `typical` (double, optional, nullable)
- `current` (double, optional, nullable)
- `first` (double, optional, nullable)
- `change_pct` (double, optional, nullable)
- `readings` (integer, optional, default: 0)
- `held` (integer, optional, default: 0)
- `low_at` (datetime, optional, nullable)
- `high_at` (datetime, optional, nullable)
- `at_a_low` (boolean, optional, default: false)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "item_id": 1,
  "days": 1,
  "title": "string",
  "currency": "string",
  "points": [
    {
      "at": "2024-01-15T09:30:00Z",
      "price": 1.1,
      "in_stock": true,
      "held": false
    }
  ],
  "own": [
    {
      "at": "2024-01-15T09:30:00Z",
      "price": 1.1,
      "in_stock": true,
      "held": false
    }
  ],
  "out_of_stock": [
    {
      "start": "2024-01-15T09:30:00Z",
      "end": "2024-01-15T09:30:00Z",
      "hours": 1.1
    }
  ],
  "stats": {
    "low": 1.1,
    "high": 1.1,
    "typical": 1.1,
    "current": 1.1,
    "first": 1.1,
    "change_pct": 1.1,
    "readings": 0,
    "held": 0,
    "low_at": "2024-01-15T09:30:00Z",
    "high_at": "2024-01-15T09:30:00Z",
    "at_a_low": false
  },
  "downsampled": false
}
```

**SDK Code**

```python
import requests

url = "https://getoutprice.com/v1/tracked-items/1/history"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://getoutprice.com/v1/tracked-items/1/history';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

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://getoutprice.com/v1/tracked-items/1/history"

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

	req.Header.Add("X-API-Key", "<apiKey>")

	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://getoutprice.com/v1/tracked-items/1/history")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

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://getoutprice.com/v1/tracked-items/1/history")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://getoutprice.com/v1/tracked-items/1/history', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://getoutprice.com/v1/tracked-items/1/history");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://getoutprice.com/v1/tracked-items/1/history")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```