Skip to content

Historical Price of XCH - API #9

@k2skaterii

Description

@k2skaterii

Let me know if there is a free API that can pull historical pricing for XCH

I'm messing with coingecko right now - A free account allows you 50 API calls per min. 50 calls per minute seems like it could be restrictive if someone's wallet has more than 50 transactions in it - but I don't think it's that big of a deal.

I was trying to get all of my transactions imported to tax.crypto.com last night, found something interesting in a help article discussing the transactions they support (URL below).

  1. How is the market price determined for cryptocurrencies?
    We use CoinGecko’s price API to determine the token price for every supported cryptocurrency. The rate we use for each day is the rate given at 00:00 am UTC of that particular day. If for some reason the rate is not available, we’ll assume the cost basis is 0 and display an error message.

I, like you, am no tax professional. And I can't quote any supporting IRS guidance to backup what they are saying... If using 1 price per day to calculate the cost basis for each transaction in our Chia wallet - then your script wouldn't necessarily have to hit the API every time a user ran the script.

Since Chia's only been tradable since May 4th 2021, you could query the daily price before hand, storing it in a CSV / JSON / file. Include that file along with your script so some new code in your script can query the price data from that file.

Attached is an sample API response, I changed the extension to .txt since github wouldn't allow me to attach a .JSON.

(https://help.crypto.com/en/articles/5019855-transaction)

https://www.coingecko.com/en/api
response_1649603496470.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions