Get a coin's price, supply and details
curl --request POST \
--url https://api.stophy.dev/v1/crypto/coin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coin": "bitcoin"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({coin: 'bitcoin'})
};
fetch('https://api.stophy.dev/v1/crypto/coin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/crypto/coin"
payload = { "coin": "bitcoin" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"coin": {
"source": "coingecko",
"url": "<string>",
"id": "<string>",
"symbol": "<string>",
"name": "<string>",
"image": "<string>",
"rank": 0,
"currency": "<string>",
"price": 123,
"marketCap": 123,
"fullyDilutedValue": 123,
"volume24h": 123,
"high24h": 123,
"low24h": 123,
"change1h": 123,
"change24h": 123,
"change7d": 123,
"change30d": 123,
"circulatingSupply": 123,
"totalSupply": 123,
"maxSupply": 123,
"ath": 123,
"athAt": "2023-11-07T05:31:56Z",
"atl": 123,
"atlAt": "2023-11-07T05:31:56Z",
"chains": [
"<string>"
],
"addedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"categories": [
"<string>"
],
"change1y": 123,
"websites": [
"<string>"
],
"whitepaper": "<string>",
"explorers": [
"<string>"
],
"socials": [
{
"url": "<string>",
"type": "<string>"
}
],
"contracts": [
{
"chain": "<string>",
"address": "<string>",
"decimals": 0
}
],
"launchedAt": "2023-11-07T05:31:56Z",
"watchlists": 0
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}Crypto
Crypto coin API
Call the Crypto coin API to get source, symbol, name, image, rank and currency, as JSON or markdown. 1 credit.
POST
/
v1
/
crypto
/
coin
Get a coin's price, supply and details
curl --request POST \
--url https://api.stophy.dev/v1/crypto/coin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coin": "bitcoin"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({coin: 'bitcoin'})
};
fetch('https://api.stophy.dev/v1/crypto/coin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/crypto/coin"
payload = { "coin": "bitcoin" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"coin": {
"source": "coingecko",
"url": "<string>",
"id": "<string>",
"symbol": "<string>",
"name": "<string>",
"image": "<string>",
"rank": 0,
"currency": "<string>",
"price": 123,
"marketCap": 123,
"fullyDilutedValue": 123,
"volume24h": 123,
"high24h": 123,
"low24h": 123,
"change1h": 123,
"change24h": 123,
"change7d": 123,
"change30d": 123,
"circulatingSupply": 123,
"totalSupply": 123,
"maxSupply": 123,
"ath": 123,
"athAt": "2023-11-07T05:31:56Z",
"atl": 123,
"atlAt": "2023-11-07T05:31:56Z",
"chains": [
"<string>"
],
"addedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"categories": [
"<string>"
],
"change1y": 123,
"websites": [
"<string>"
],
"whitepaper": "<string>",
"explorers": [
"<string>"
],
"socials": [
{
"url": "<string>",
"type": "<string>"
}
],
"contracts": [
{
"chain": "<string>",
"address": "<string>",
"decimals": 0
}
],
"launchedAt": "2023-11-07T05:31:56Z",
"watchlists": 0
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
crypto.coin - Returns:
datahascoin. - Cost: 1 credit. Failed calls cost nothing.
- Paging: No.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.crypto.coin({ coin: "bitcoin" });
console.log(result.data.coin);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.crypto.coin(coin="bitcoin")
print(result["data"]["coin"])
curl -X POST https://api.stophy.dev/v1/crypto/coin \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"coin":"bitcoin"}'
stophy crypto coin bitcoin
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json