Can't fetch historical prices with Pyth Terminal API

Hey, I subscribed to the Pyth Terminal Starter plan a few days ago, but since upgrading, I have been unable to retrieve historical prices correctly through the authenticated v2 API.

For example, I request data for Unix timestamp 1717632000:

curl -X 'GET' 
'https://pyth.dourolabs.app/hermes/v2/updates/price/1717632000?ids[]=e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43' 
-H 'accept: application/json' 
-H 'Authorization: Bearer MY_API_TOKEN'

Instead of returning the price published around the requested timestamp, the response contains a recent publish time—approximately three hours before the request. For example, one response returned 1783937703. Each time I call the endpoint, the publish time changes while remaining roughly three hours behind the current time.

However, the unauthenticated v1 API returns the correct historical publish time for the same timestamp and price-feed ID:

curl -X 'GET' \
  'https://benchmarks.pyth.network/v1/updates/price/1717632000?ids=e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43&encoding=hex&parsed=true' \
  -H 'accept: application/json'

Can you explain why the paid Starter plan’s v2 endpoint is not returning the requested historical price, while the v1 endpoint works correctly? Historical price access was one of the reasons I subscribed, so I would appreciate either instructions for the correct paid endpoint or confirmation that this is a bug that will be fixed.

Hey Shawn,

The endpoint in your example is the Hermes/Pyth Core-compatible API: pyth.dourolabs.app/hermes/v2/updates/price/{publish_time}

For Pyth Terminal historical data, please use the Pyth Pro History API instead:

bash

curl -H “Authorization: Bearer ***”
https://pyth.dourolabs.app/v1/fixed_rate@200ms/history?symbol=Crypto.BTC/USD&from=1717632000&to=1717718400&resolution=60

If you need point-in-time prices:

bash

curl -H “Authorization: Bearer ***”
https://pyth.dourolabs.app/v1/fixed_rate@200ms/price?ids=1&timestamp=1717632000000000

Note: benchmarks.pyth.network is the legacy Pyth Core historical endpoint and is being deprecated. Please use Pyth Pro going forward (Preparing for the Pyth Core upgrade | Pyth Developer Hub).

Thanks for your reply.

I believe the information on the Preparing for the Pyth Core upgrade | Pyth Developer Hub page caused some confusion. It states that an API key will be required by July 31 and that using an API key requires upgrading to the Pyth Pro API. However, the page links to the older Pyth Core/Hermes documentation, which led me to believe that the API key and paid plan applied to those endpoints as well.

That is why I misunderstood how the paid API was intended to be used. It may be helpful to update the page or clarify the distinction between the older Hermes endpoints and the Pyth Pro API.

The API key requirement is for continuing historical price access through Pyth Pro. The older Pyth Core/Hermes historical endpoints are legacy and will be deprecated, so new integrations should use the Pyth Pro /v1/{channel}/price or /v1/{channel}/history endpoints instead.

Hey just want to ensure, the examples you provided above doesn’t include data that I can sent to smart contract for on-chain verification. If I need that, should I call API like this?

curl -X POST https://pyth-lazer.dourolabs.app/v1/price -H "Authorization: Bearer ***" -H "Content-Type: application/json" -d '{"priceFeedIds": [1, 2],"properties": ["price", "exponent", "publisherCount", "confidence"],"formats": ["evm"],"jsonBinaryEncoding": "hex","channel": "fixed_rate@50ms","timestamp": 1758690761750000}'

Please notice that the domain is pyth-lazer. I’m just wondering if this way is valid after July 31 since we want to migrate without any downtime.

Hello,

I’m becoming increasingly confused by the documentation, as it does not clearly explain how to satisfy what seems like a straightforward use case.

My requirement is to retrieve the price data for a specific historical timestamp in a hex-encoded format, then submit that data to my existing EVM smart contract for on-chain verification.

After reading the documentation several times, my understanding is that using the Pyth Pro API would require my smart contract to integrate with or migrate to the Pyth Lazer contracts. That would be a contract-level integration change, not simply an API endpoint upgrade.

Could you please clarify the simplest supported way to do the following?

  1. Request the price for a specific historical timestamp.
  2. Receive the corresponding signed, hex-encoded price update data.
  3. Submit that data to an existing EVM smart contract for verification.

Is this possible using the standard Pyth contracts, or is migrating to Pyth Lazer mandatory?

The current documentation makes the relationship between the Pro API, historical price retrieval, and the required on-chain contracts unnecessarily difficult to understand. A direct example covering this exact workflow would be very helpful.

Thanks.

yes, for signed payloads that can be submitted on-chain, you should use the Pyth Pro REST endpoint: https://pyth-lazer.dourolabs.app/v1/price

with formats: ["evm"] and jsonBinaryEncoding: "hex", like in your example.

Important distinction: that evm payload is for the Pyth Pro/Lazer EVM contracts. It is not a drop-in replacement for the legacy Pyth Core/Hermes payload used by existing Pyth Core EVM contracts.

Thanks for the reply. it’s clearer now. I just want to confirm again: to use that payload, do I need to update and migrate my smart contract to Pyth Lazer compatible version as you mentioned, correct?

And also, why can’t I see the Ethereum mainnet address from the Pyth Pro contract list?Contract Addresses | Pyth Developer Hub

How do I use the payload on Ethereum mainnet without an contract address?

If you want to use the Pyth Pro evm payload from POST https://pyth-lazer.dourolabs.app/v1/price, then your smart contract needs to integrate with the Pyth Pro/Lazer EVM contract interface.

That payload is not compatible with the Pyth Core updatePriceFeeds(...) interface.

For Ethereum mainnet today, you should use the upgraded Pyth Core path instead:

  1. Fetch the Core-compatible update from upgraded Hermes: https://pyth.dourolabs.app/hermes
  2. Submit the returned update.binary.data to the upgraded Pyth Core contract using the normal updatePriceFeeds(...) flow.

Upgraded Pyth Core contract addresses: Upgraded Contract Addresses | Pyth Developer Hub
Pyth Core EVM upgrade guide: EVM | Pyth Developer Hub

The Pyth Pro/Lazer contract-address page does not currently list Ethereum mainnet, so the Pyth Pro evm payload is not usable as is on Ethereum mainnet today. The day Pyth Pro contract is on Ethereum mainnet, it would.

Thanks for the clarification. I now understand that the Pyth Pro/Lazer payload is not compatible with existing Pyth Core contracts and that Pyth Pro/Lazer is not currently available on Ethereum mainnet.

However, this leaves a gap for existing Ethereum mainnet users who need to retrieve signed historical prices and submit them through the standard Pyth Core updatePriceFeeds(...) flow. The upgraded Hermes endpoint appears to provide only recent data, while the legacy Benchmarks API can retrieve much older historical updates.

Would it be possible to add historical price support to the paid Pyth Core-compatible API? Ideally, it would:

  • Support historical timestamps older than three hours.

  • Return signed payloads compatible with Pyth Core updatePriceFeeds(...).

  • Work with existing contracts on Ethereum mainnet without requiring a migration to Pyth Pro/Lazer.

I subscribed to the Starter plan expecting it to provide a migration path for this existing historical-price workflow. It would be very helpful if the paid API could retain the functionality currently available through the legacy Benchmarks endpoint.

I see the confusion, and we are working to fix it in the docs as well.

We have upgraded Core contracts on Ethereum mainnet here.

If you use these APIs to fetch the signed payload, you will be able to parse the prices on the above Ethereum and other chain Upgraded Core contracts.

You can not use the old hermes data on the new upgraded Core contracts.

In regards to historical data in the new hermes data, I will follow up and give you more light soon.