Authentication
3 min
The Pricemoov API uses API keys to authenticate requests.
Generating an authentication Token
Your authentication token carries many privileges, so keep them secure! Do not share your key in publicly accessible areas like GitHub, client-side code, etc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail. See the error section.
The default lifetime of JWT tokens is 24h
fetch('https://api.pricemoov.com/login/', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', password: 'XXXYYYYZZZ'})
})
.then(response => response.json())
.then(data => {
const token = data.token;
// do something with the token
})
.catch(error => console.error(error));
Using the authentication Token to make HTTP requests
import requests
token = 'xxxxxx' # replace with actual JWT token
url = 'https://api.pricemoov.com/example' # replace with actual URL
response = requests.get(url, headers={'Authorization': f'jwt {token}'})
print(response.json())