Market Snapshot
PRO320 words · 2 min read
Overview
This documentation describes how to use the Market Snapshot
endpoint to access a summary of current market trends for cryptocurrencies, including the number and percentage of coins trending up, down, or neutral.
Endpoint
GET /api/v2/market/snapshot
Retrieve a snapshot of the current market trends, providing an overview of how many coins are trending in each direction.
Base URL
https://api.guavy.com
Full Endpoint Example
https://api.guavy.com/api/v2/market/snapshot
Authentication
This API requires authentication using a Bearer token. Include your API key in the request header as shown below.
Request Headers
Header | Description |
---|---|
Authorization | Bearer token for API authentication. |
Example Header
-H "Authorization: Bearer YOUR-API-KEY"
Response Format
The response returns data in JSON format, containing an overview of the current market trends for cryptocurrencies.
Example Response
{
"Success": {
"number_of_coins_trending_up": 164,
"number_of_coins_trending_down": 314,
"number_of_coins_trending_neutral": 82,
"percent_of_coins_trending_up": 29.28571428571429
}
}
Field Descriptions
Field | Type | Description |
---|---|---|
number_of_coins_trending_up | integer | The number of coins currently experiencing an upward trend. |
number_of_coins_trending_down | integer | The number of coins currently experiencing a downward trend. |
number_of_coins_trending_neutral | integer | The number of coins currently with a neutral trend. |
percent_of_coins_trending_up | float | The percentage of coins that are currently trending up, calculated as a float. |
Code Examples
cURL
curl -X GET "https://api.guavy.com/api/v2/market/snapshot" \
-H "Authorization: Bearer YOUR-API-KEY"
Python (requests library)
import requests
url = "https://api.guavy.com/api/v2/market/snapshot"
headers = {
"Authorization": "Bearer YOUR-API-KEY"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print(data)
else:
print("Failed to retrieve data:", response.status_code)
JavaScript (fetch API)
fetch("https://api.guavy.com/api/v2/market/snapshot", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR-API-KEY",
},
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));