Skip to content
📡 API

Embedbase

The Embedbase API requires you to create an API key (opens in a new tab).

Note: You can also use our JavaScript client.

Getting Started

There's two main operations you can do with Embedbase: search and insert.

Retrieving Data

You can search unstructured data with Embedbase.

const URL = 'https://api.embedbase.xyz'
const DATASET_ID = 'people'
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${DATASET_ID}/search`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + API_KEY
  },
  body: JSON.stringify({
    query: 'Something about a red planet'
  })
})

Inserting Data

You can insert unstructured data into Embedbase to be indexed and searched.

const URL = 'https://api.embedbase.xyz'
const DATASET_ID = 'people'
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${DATASET_ID}`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + API_KEY
  },
  body: JSON.stringify({
    documents: [
      {
        data: 'Elon is sipping a tea on Mars'
      }
    ]
  })
})

Updating Data

You can update your data like this:

const URL = 'https://api.embedbase.xyz'
const DATASET_ID = 'people'
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${DATASET_ID}`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + API_KEY
  },
  body: JSON.stringify({
    documents: [
      {
        id: '<some id>',
        data: 'Elon is sipping a tea on Neptune'
      }
    ]
  })
})

Delete data

You can delete documents from a dataset like this:

const URL = 'https://api.embedbase.xyz'
const DATASET_ID = 'people'
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${DATASET_ID}`, {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + API_KEY
  },
  body: JSON.stringify({
    ids: ["<some id>",]
  })
})

Delete dataset

You can delete a dataset like this:

const URL = 'https://api.embedbase.xyz'
const DATASET_ID = 'people'
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${DATASET_ID}/clear`, {
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer ' + API_KEY
  },
})