General
Generating requests
When making requests using Scaler’s API you need to first request a Bearer token from your account team. The token should be included in the Authorization header as a Bearer token.
Authorization
Each request will need an Authorization header set with your Bearer token that you’ve received from the Scaler team. Each token will be associated with a Scaler user account and will have the same access level controls as that user.
import requests
resp = requests.post(
'https://api.scalerglobal.com/v1/get/asset-characteristics/34543',
headers={"Authorization": "Bearer YOUR_TOKEN"})
print(resp)Metadata & Pagination
When making requests to the Scaler API, you may receive paginated results.
The response will include pagination metadata in the data object, besides the actual data.
These results can be paginated using the following query parameters:
| Parameter | Description |
|---|---|
| page | The page number to retrieve. Default is 1. |
| per_page | The number of items to retrieve per page. The default may vary per endpoint. |
Example Request
https://api.scalerglobal.com/v1/portfolios?page=1&per_page=10
Response
{
"success": true,
"message": "Success",
"data": {
"data": [
{
"id": 234,
"name": "Impact Fund X"
},
{
"id": 235,
"name": "Retail Fund "
},
...
],
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://api.scalerglobal.com/v1/portfolios?page=1&per_page=10",
"label": "1",
"active": true
},
{
"url": "https://api.scalerglobal.com/v1/portfolios?page=2&per_page=10",
"label": "2",
"active": false
},
{
"url": "https://api.scalerglobal.com/v1/portfolios?page=2&per_page=10",
"label": "Next »",
"active": false
}
],
"path": "https://api.scalerglobal.com/v1/portfolios",
"per_page": 10,
"to": 10,
"total": 20
}
}