API reference
Getting started with the Ouro API.
You can interact with the API through HTTP requests from any language, via our official Python bindings, our official Node.js library.
To install the official Python bindings, run the following command:
pip install ouro-py
To install the official Node.js library, run the following command in your Node.js project directory:
npm install ouro-js
You'll need an Ouro account before you can use the API. Once you're signed up, create and copy your API key from your account settings. See the Authentication section for more details.
Web API only
Generate an access token
POST https://api.ouro.foundation/users/get-token
Client libraries will handle this step automatically. Prior to any other HTTP requests, exchange your API key for a token. The token must be included in your Authentication header for all requests.
Request body:
{
"pat": "YOUR_API_KEY"
}
Response:
{
"token": "GENERATED_TOKEN",
"error": null
}
Including the token in HTTP requests
Include your generated token in the Authentication header.
Example of how to include the token in a request:
GET https://api.ouro.foundation/users/hermes
Authorization: GENERATED_TOKEN
Users
Follow a user
PUT https://api.ouro.foundation/users/:username/follow
Follows the user specified by username. If you are already following the user, the request will unfollow the user.
URL parameters:
username
(string). The username of the requested user.
No request body required
Read a user's follows
GET https://api.ouro.foundation/users/:username/follows
Retrieves a list of users being followed and following the specified user.
URL parameters:
username
(string). The username of the requested user.
Response:
{
"data": [
{
"id": "uuid",
"user_id": "uuid",
"followed_user_id": "uuid",
"added_at": "timestamp"
}
// Continued...
],
"error": null
}
Common
Routes common to all of the elements and assets they contain.
Purchase an asset
POST https://api.ouro.foundation/elements/common/purchase-asset
Initiates the purchase of an asset. Define the asset you want to purchase by it's type and ID. The request will fail if your account does not have enough credit to cover the cost of the asset.
Request body:
{
"assetType": "string",
"assetId": "uuid"
}
Response:
{
"data": {
"charge": {
// Charge details object
},
"transfer": {
// Transfer details object
}
},
"error": null
}
Read permissions
GET https://api.ouro.foundation/datasets/:id/permissions
Retrieves the permissions settings of a specific dataset.
URL parameters:
id
(uuid). The ID of the requested dataset.
Share an asset
PUT /datasets/:id/share
Updates permission settings for a specific dataset by adding the specified user. Only users with admin permissions on the dataset have the ability to share a dataset.
Permission grants the user a read
, write
, or admin
role on the asset as specified.
URL parameters:
id
(uuid). The ID of the requested dataset.
Request body:
{
"permission": {
"user": {
"user_id": "uuid"
},
"role": "string"
}
}