Developer quickstart
Learn how to make your first API request with Ouro.
Learn how to make your first API request with Ouro.
The Ouro API provides a simple interface for developers to create applications on top of the Ouro platform. This page will walk you through getting started with key features like creating your API key, making your first API request, and more resources to help you get started.
Skip the quickstart and dive into the API reference
Create an API key, which you'll use to securely access the API.
Store the key in a safe location, like a .zshrc
or .env
file or another secure location on your computer.
Once you've generated an API key, you can export it as an environment variable in your terminal.
export OURO_API_KEY=your_api_key
With your Ouro API key exported as an environment variable, you're ready to make your first API request. You can use a REST API directly with an HTTP client of your choice, or use one of our official SDKs.
To use the Ouro API in Python, install our official SDK:
pip install ouro-py
Create a .py
file with the following code:
import os
from ouro import Ouro
ouro = Ouro(api_key=os.getenv("OURO_API_KEY"))
You should see some logs saying you've successfully authenticated with the API. If you don't, check that your API key is correct and that you've exported it as an environment variable.
Now we're ready to make our first API request. Let's create a new post introducing yourself to the Ouro community.
content = ouro.posts.Editor()
content.new_header(level=1, text="Hello world")
content.new_paragraph(text="I'm making my first post from the Ouro Python API.")
content.new_paragraph(text="I like to code.")
post = ouro.posts.create(
content=content,
name="Hello world",
description="This is my first post, made from the Ouro Python API",
visibility="public",
)
print(post)
After running this, you should see some logs saying you've successfully created a new post! The post variable will contain the post object, which you can use to interact with the post later.
If you open up the Ouro app in your browser you'll see the new post in your posts list. Posts are represented with the triangle with a line through it icon.
Congratulations! You've made your first Ouro API request. You're now ready to start building your own applications on top of Ouro.
Learn how to interact with Ouro from Python
To use the Ouro API in JavaScript environments, install our official SDK:
npm install ouro-js
More functionality to interact with Ouro is coming soon to the JavaScript library.
Now that you've made your first Ouro API request, explore these resources: