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-47@example-47.com"
}
]
}
}
},
{
"type": "search_result",
"data": {
"id": "1CLJt2vA3GEGcxEhVY1EbS",
"type": "file",
"name": "Albert's Report",
"filename": "test.txt",
"size": 3,
"download_url": "https://api.moonbase.ai/asset_redirects/1CLJt2vAY2dWSPDQt8AQpz?token=eyJfcmFpbHMiOnsiZGF0YSI6eyJpZCI6IjFDTEp0MnZBWTJkV1NQRFF0OEFRcHoiLCJibG9iX2lkIjoiMUNMSnQydkFIZVJ0WGZqNEJxNXBpRCIsImNyZWF0ZWRfYXQiOiIyMDI1LTAyLTE3VDE2OjAwOjAwLjAwMFoiLCJuYW1lIjoiZmlsZSIsInJlY29yZF9pZCI6IjFDTEp0MnZBM0dFR2N4RWhWWTFFYlMiLCJyZWNvcmRfdHlwZSI6IkxpYnJhcnlBc3NldCJ9LCJleHAiOiIyMDI1LTAyLTE3VDE3OjAwOjAwLjAwMFoiLCJwdXIiOiJyZWRpcmVjdCJ9fQ--a28630b2b8f96fb7473e36c0f73cc8495b49e72b",
"associations": [],
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z"
}
}
]
}Returns items and files that match the search query.
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-47@example-47.com"
}
]
}
}
},
{
"type": "search_result",
"data": {
"id": "1CLJt2vA3GEGcxEhVY1EbS",
"type": "file",
"name": "Albert's Report",
"filename": "test.txt",
"size": 3,
"download_url": "https://api.moonbase.ai/asset_redirects/1CLJt2vAY2dWSPDQt8AQpz?token=eyJfcmFpbHMiOnsiZGF0YSI6eyJpZCI6IjFDTEp0MnZBWTJkV1NQRFF0OEFRcHoiLCJibG9iX2lkIjoiMUNMSnQydkFIZVJ0WGZqNEJxNXBpRCIsImNyZWF0ZWRfYXQiOiIyMDI1LTAyLTE3VDE2OjAwOjAwLjAwMFoiLCJuYW1lIjoiZmlsZSIsInJlY29yZF9pZCI6IjFDTEp0MnZBM0dFR2N4RWhWWTFFYlMiLCJyZWNvcmRfdHlwZSI6IkxpYnJhcnlBc3NldCJ9LCJleHAiOiIyMDI1LTAyLTE3VDE3OjAwOjAwLjAwMFoiLCJwdXIiOiJyZWRpcmVjdCJ9fQ--a28630b2b8f96fb7473e36c0f73cc8495b49e72b",
"associations": [],
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z"
}
}
]
}Documentation Index
Fetch the complete documentation index at: https://docs.moonbase.ai/llms.txt
Use this file to discover all available pages before exploring further.
Your Moonbase API key.
The search text to match against items and files.