Links

Getting past authentication

How you can get access to limited endpoints.

Step 1: Request API access

Head on over to bit.ly/ratedAPIkeys and go through the "request access flow". We promise we will do our best to prematerialize valid profiles in the admin view that's to come in Q1 2023.

Step 2: Receive credentials from Rated

For valid profiles/requests, we will follow up with your access credentials, namely username and password. Once you have those then you can proceed to request bearer tokens.

Step 3: Get a bearer token

Once you get your credentials, you can generate multiple keys if you need to.
post
/v0/auth/token
Login For Access Token
Curl
Python
curl -X 'POST' \
'https://api.rated.network/v0/auth/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=&username=<YOUR-EMAIL-HERE>&password=<YOUR-PASSWORD-HERE>'
import requests
response = requests.post(
"https://api.rated.network/v0/auth/token",
data={
"username": "[email protected]",
"password": "super-safe-passphrase",
},
)
content = response.json()
my_token = content["accessToken"]
The response of that request will contain the token, then you can use that token to authenticate and request data:
Curl
Python
curl -X 'GET' \
'https://api.rated.network/v0/eth/validators/<ID OR PUBKEY>' \
-H 'accept: application/json' \
-H 'X-Rated-Network: mainnet' \
-H 'Authorization: Bearer <YOUR-TOKEN-HERE>'
# my_token contains a JWT you got in the previous step
from pprint import pprint
response = requests.get(
"https://api.rated.network/v0/eth/validators/69/effectiveness",
headers={"Authorization": f"Bearer {my_token}"},
)
content = response.json()
pprint(content["data"])

Step 4: Resetting your password

Be aware that all your keys get invalidated if you reset your password.
Curl
Python
curl -X 'POST' \
'https://api.rated.network/v0/users/me/password-reset' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR-TOKEN-HERE>'
import requests
response = requests.post(
"https://api.rated.network/v0/users/me/password-reset",
headers={"Authorization": f"Bearer {my_token}"},
)
content = response.json()
my_new_password = content["password"]