Using the REST APIs

Every stream on Beneath is available via a REST API. Using your language of choice, you can access the data and import into your environment. We provide examples below for the Command Line, Python, and Javascript.

You will need to replace SECRET with your API key, PROJECTNAME with your project name, and STREAMNAME with your stream name. Your SECRET can be found on the “Secrets” tab on your profile page.

Command line:

curl -H "Authorization: SECRET" https://beneath.network/projects/PROJECTNAME/streams/STREAMNAME

Python:

import requests

r = requests.get('https://beneath.network/projects/PROJECTNAME/streams/STREAMNAME', headers={"authorization":"Bearer SECRET"})
r.json()

Javascript:

fetch("https://beneath.network/projects/PROJECTNAME/streams/STREAMNAME", {
  "Authorization": "Bearer SECRET",
  "Content-Type": "application/json",
})
.then(res => res.json())
.then(data => {
  // TODO: Add your logic here
  console.log(data)
})