---
agentTools:
  projectIndex: https://web3-shards.readme.io/llms.txt
---

# /prices/history/pool

Returns the USD price of a given pool address at a given time

```javascript
"use strict";
const Shards = require("web3-shards");

const shards = Shards.API.Ethereum.V1;
shards.configure({
    apiKey: "YOUR_API_KEY", // Join the discord to get your api key. https://discord.com/invite/kJd8W7Nh7e
    maxRequestsPerSecond:5, // client-side limiter to prevent accidental burning
    logger: 1               // 0=none,1=errors,2=verbose
});

const getPrice = async function() {
    const address = "0xefb47fcfcad4f96c83d4ca676842fb03ef20a477";
    const resp = await shards.prices.getPoolPriceAtTime(address, 1688915290);
    console.log(resp)
}

getPrice();
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Shards API V1",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.web3shards.io/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "x-default": "db2f88b1-21cd-440b-9e8c-486a8688e34e",
        "name": "X-Api-Key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/prices/history/pool": {
      "get": {
        "summary": "/prices/history/pool",
        "description": "Returns the USD price of a given pool address at a given time",
        "operationId": "prices-history-pool",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "The contract address of the pool",
            "required": true,
            "schema": {
              "type": "string",
              "default": "0xefb47fcfcad4f96c83d4ca676842fb03ef20a477"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "The epoch seconds from which to search for the price of the pool.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1688915290
            }
          },
          {
            "name": "chain",
            "in": "query",
            "description": "The target chain. One of eth | bsc | shibarium.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eth",
                "bsc",
                "shibarium"
              ],
              "default": "eth"
            }
          },
          {
            "name": "X-Api-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "db2f88b1-21cd-440b-9e8c-486a8688e34e"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 200,\n    \"price\": 1.4291245536312303\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 200,
                      "default": 0
                    },
                    "price": {
                      "type": "number",
                      "example": 1.4291245536312303,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 400,\n    \"error\": \"Bad request\",\n    \"code\": 400\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "error": {
                      "type": "string",
                      "example": "Bad request"
                    },
                    "code": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 429,\n    \"error\": \"Too Many Requests\",\n    \"code\": 429\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 429,
                      "default": 0
                    },
                    "error": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "code": {
                      "type": "integer",
                      "example": 429,
                      "default": 0
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "64402e73f9d01b0f649773db:64e23c27ac6fb4002cd430b3"
}
```