Last active
September 16, 2024 02:40
-
-
Save idealwebsolutions/3ba119b621a1573e19e75cc118ef5350 to your computer and use it in GitHub Desktop.
Price spot endpoints for ETH and BTC using Coinbase API v2 (no auth required)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Endpoints for Coinbase API | |
curl -s https://api.coinbase.com/v2/prices/eth-usd/spot -H 'CB-VERSION: 2015-04-08' | jq -r ".data.amount" | sed -E 's/(.+)/$\1/' | |
curl -s https://api.coinbase.com/v2/prices/btc-usd/spot -H 'CB-VERSION: 2015-04-08' | jq -r ".data.amount" | sed -E 's/(.+)/$\1/' | |
# Endpoints for Gemini Ticker API | |
curl -s https://api.gemini.com/v1/pubticker/ethusd | jq -r 'select(.ask != null)' | sed -E 's/(.+)/$\1/' | |
curl -s https://api.gemini.com/v1/pubticker/btcusd | jq -r 'select(.ask != null)' | sed -E 's/(.+)/$\1/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment