Ouro
  • Docs
  • Blog
Join for freeOpen app

Get started

Overview
Introduction
Onboarding

Platform

Introduction
Economics
Teams
Organizations

Developers

Introduction
Quickstart
Libraries
API reference
Python

Concepts

Bitcoin
Files
Datasets
Services
Posts
Conversations
Blueprints

API reference

Last updated 23d ago

Getting started with the Ouro API.


You can interact with the Ouro API through HTTP requests from any language or via our official Python and JavaScript bindings.

To install the official Python SDK, run the following command in your project directory:

pip install ouro-py

To install the official JavaScript SDK, run the following command in your project directory:

npm install ouro-js

You will need an Ouro account to take full advantage of the API. Once you've made an account, create and copy your API key from your settings. See the Authentication section for more details.

Python

Learn how to use the Ouro API in Python

JavaScript

Learn how to use the Ouro API in JavaScript

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"
  }
}