Skip to main content
POST
/
search
JavaScript
import Moonbase from '@moonbaseai/sdk';

const client = new Moonbase({
  apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});

const response = await client.search({ query: 'query' });

console.log(response.data);
{
  "type": "list",
  "data": [
    {
      "type": "search_result",
      "data": {
        "id": "1CLJt2v5aNd8G5SGzEaeVU",
        "type": "item",
        "collection": {
          "id": "1CLJt2ubZ7zAZFBxUxeBHo",
          "type": "collection",
          "ref": "people"
        },
        "values": {
          "name": {
            "type": "value/text/single_line",
            "data": "Albert Einstein"
          },
          "email": [
            {
              "type": "value/email",
              "data": "person-65@example-65.com"
            }
          ]
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Query Parameters

query
string
required

The search text to match against items.

Response

Successful response.

A list of search results.

type
string
required
Allowed value: "list"
data
object[]
required