📅  最后修改于: 2023-12-03 15:00:37.782000             🧑  作者: Mango
Are you looking for the latest Ethereum price in NZD? Look no further! Our API provides real-time and historical data for Ethereum prices in New Zealand dollars.
The API endpoint for Ethereum price in NZD is:
https://api.example.com/ethereum/nzd
There are no required request parameters for this API endpoint.
However, the following optional parameters can be used:
| Parameter | Type | Description | | --------- | ------ | ---------------------------------------------------------------- | | limit | int | The maximum number of prices to return. Default: 10, Max: 100. | | days | int | The number of days of historical prices to retrieve. Default: 7. | | start | string | The start date for historical prices in format YYYY-MM-DD. | | end | string | The end date for historical prices in format YYYY-MM-DD. |
The API response is returned in JSON format.
The response object contains the following properties:
{
"success": true,
"data": [
{
"timestamp": 1629253860,
"price": 3456.78
},
{
"timestamp": 1629250321,
"price": 3456.12
},
...
]
}
The data
property is an array of objects representing the Ethereum price at different timestamps. Each object contains a timestamp
property, which is the Unix timestamp of the price, and a price
property, which is the Ethereum price in NZD at that timestamp.
Here is an example Python code snippet for retrieving the latest Ethereum price in NZD using our API:
import requests
url = 'https://api.example.com/ethereum/nzd'
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print('Latest Ethereum price in NZD:', data['data'][0]['price'])
else:
print('Error:', response.status_code)
Now you know how to retrieve the latest Ethereum price in NZD using our API. Try it out and see how easy it is!