> ## Documentation Index
> Fetch the complete documentation index at: https://data.ornn.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get memory price history

## Overview

Historical spot prices for a single memory type, oldest-first - pair this with `/api/memory-types` to discover valid `memoryType` values.


## OpenAPI

````yaml openapi.yaml GET /api/memory/{memoryType}/history
openapi: 3.1.0
info:
  title: Ornn Data API
  version: 1.0.0
  description: >
    Read-only REST API for GPU and memory market data. The price index is the
    going rate of compute in USD per GPU-hour, a weighted average of all
    verified compute transactions across the market.
servers:
  - url: https://api.ornnai.com
security:
  - bearerAuth: []
tags:
  - name: Current Prices
  - name: Historical Prices
  - name: Analytics
  - name: Memory
  - name: Token Prices
  - name: Workload Cost
  - name: LLM Coding
  - name: Neo-Cloud Sites
  - name: Reference
paths:
  /api/memory/{memoryType}/history:
    get:
      tags:
        - Memory
      summary: Get memory price history
      parameters:
        - name: memoryType
          in: path
          required: true
          description: A tracked memory type. URL-encode spaces and slashes.
          schema:
            type: string
            example: DDR4 16Gb (2Gx8) 3200
        - name: startDate
          in: query
          schema:
            type: string
        - name: endDate
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            default: 1000
      responses:
        '200':
          description: Memory price history.
          content:
            application/json:
              example:
                success: true
                memoryType: DDR4 16Gb (2Gx8) 3200
                count: 5
                data:
                  - date: '2026-01-01T00:00:00.000Z'
                    memoryType: DDR4 16Gb (2Gx8) 3200
                    category: dram
                    price: 40
                    weeklyHigh: 50
                    weeklyLow: 30
                    changePct: 0
                    sourceUpdatedAt: '2026-01-01T00:00:00.000Z'
                    timestamp: '2026-01-01T00:00:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            "https://api.ornnai.com/api/memory/DDR4%2016Gb%20(2Gx8)%203200/history?limit=5"
            \
              -H "Authorization: Bearer YOUR_API_KEY"
        - lang: python
          label: Python
          source: |
            import requests

            resp = requests.get(
                "https://api.ornnai.com/api/memory/DDR4 16Gb (2Gx8) 3200/history",
                params={"limit": 5},
                headers={"Authorization": "Bearer YOUR_API_KEY"},
            )
        - lang: javascript
          label: JavaScript
          source: |
            const type = encodeURIComponent("DDR4 16Gb (2Gx8) 3200");
            const res = await fetch(
              `https://api.ornnai.com/api/memory/${type}/history?limit=5`,
              { headers: { Authorization: "Bearer YOUR_API_KEY" } },
            );
            const data = await res.json();
        - lang: php
          label: PHP
          source: >
            <?php

            $type = rawurlencode("DDR4 16Gb (2Gx8) 3200");

            $url = "https://api.ornnai.com/api/memory/" . $type .
            "/history?limit=5";

            $ch = curl_init($url);

            curl_setopt_array($ch, [
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"],
            ]);

            $data = json_decode(curl_exec($ch), true);
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc main() {\n\tendpoint := \"https://api.ornnai.com/api/memory/\" + url.PathEscape(\"DDR4 16Gb (2Gx8) 3200\") + \"/history?limit=5\"\n\treq, _ := http.NewRequest(\"GET\", endpoint, nil)\n\treq.Header.Set(\"Authorization\", \"Bearer YOUR_API_KEY\")\n\tresp, _ := http.DefaultClient.Do(req)\n\tdefer resp.Body.Close()\n\tbody, _ := io.ReadAll(resp.Body)\n\t_ = body\n}\n"
        - lang: java
          label: Java
          source: >
            import java.net.URI;

            import java.net.http.HttpClient;

            import java.net.http.HttpRequest;

            import java.net.http.HttpResponse;


            HttpClient client = HttpClient.newHttpClient();

            HttpRequest request = HttpRequest.newBuilder(
                    URI.create("https://api.ornnai.com/api/memory/DDR4%2016Gb%20(2Gx8)%203200/history?limit=5"))
                .header("Authorization", "Bearer YOUR_API_KEY")
                .build();
            HttpResponse<String> response = client.send(request,
            HttpResponse.BodyHandlers.ofString());
        - lang: ruby
          label: Ruby
          source: >
            require "net/http"

            require "json"


            uri =
            URI("https://api.ornnai.com/api/memory/DDR4%2016Gb%20(2Gx8)%203200/history?limit=5")

            req = Net::HTTP::Get.new(uri)

            req["Authorization"] = "Bearer YOUR_API_KEY"

            res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http|
            http.request(req) }

            data = JSON.parse(res.body)
components:
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
            message: 'API key required. Use Authorization: Bearer YOUR_API_KEY'
    NotFound:
      description: No data found for the given parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: No data available
            message: No daily index data found for H100 SXM
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: Bad request
        message:
          type: string
          example: >-
            Invalid GPU type. Allowed: H100 SXM, H200, A100 SXM4, RTX 5090,
            B200, RTX PRO 6000 WS
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token. Create one in the dashboard.

````