Tensor API introduction
The Tensor API is a RESTful API that allows you to interact with the Tensor Cloud platform programmatically. Currently, the API is in beta and is subject to change.
Permitted API usage
You may not resell or redistribute the Tensor API or any data derived from it without explicit written permission from Tensor Energy. Contact us if the total capacity of assets that benefit from usage of the Tensor API exceeds 1 MW.
Authentication
The Tensor API supports token-based authentication. To authenticate, include your API key in the x-api-key
header of your request. For example:
- cURL
- Python
- Typescript
curl --request GET \
--url https://api.tensorenergy.jp/service-price-forecast \
--header 'x-api-key: ${API_TOKEN}'
import requests
API_URL = 'https://api.tensorenergy.jp/service-price-forecast'
API_TOKEN = 'YOUR_API_KEY'
headers = {
'x-api-key': f'{API_TOKEN}',
}
response = requests.get(API_URL, headers=headers)
print(response.json())
import axios from 'axios';
const API_URL = 'https://api.tensorenergy.jp/service-price-forecast';
const API_TOKEN = 'YOUR_API_KEY';
const fetchData = async () => {
try {
const response = await axios.get(API_URL, {
headers: {
'x-api-key': `${API_TOKEN}`,
},
});
console.log(response.data);
} catch (error) {
console.error(error);
}
};
fetchData();
How to obtain an API key
To obtain an API key, please contact Tensor support.
Rate limits
The number of requests you can make to the Tensor API depends on the specific API endpoint, but overall usage is limited to 500 requests per day. If you exceed this limit, you will receive a 429 Too Many Requests
response.