List
client.search.vals.list(ValListParams { limit, offset, query } query, RequestOptionsoptions?): PageCursorURL<BasicVal { id, author, code, 9 more } >
/v1/search/vals
Search for vals across the platform
Parameters
Returns
import ValTown from "npm:@valtown/sdk";
const client = new ValTown();
// Automatically fetches more pages as needed.
for await (const basicVal of client.search.vals.list({ limit: 1, offset: 0, query: 'x' })) {
console.log(basicVal.id);
}
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"author": {
"id": "00000000-0000-0000-0000-000000000000",
"username": "tmcw"
},
"code": "export const count = 1;",
"createdAt": "2024-06-11T22:05:12.585Z",
"links": {
"module": "https://example.com",
"self": "https://example.com",
"versions": "https://example.com",
"endpoint": "https://example.com"
},
"name": "counter",
"privacy": "public",
"public": true,
"type": "script",
"updatedAt": "2019-12-27T18:11:19.117Z",
"url": "https://val.town/v/tmcw/counter",
"version": 0
}
],
"links": {
"self": "https://example.com",
"next": "https://example.com",
"prev": "https://example.com"
}
}Returns Examples
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"author": {
"id": "00000000-0000-0000-0000-000000000000",
"username": "tmcw"
},
"code": "export const count = 1;",
"createdAt": "2024-06-11T22:05:12.585Z",
"links": {
"module": "https://example.com",
"self": "https://example.com",
"versions": "https://example.com",
"endpoint": "https://example.com"
},
"name": "counter",
"privacy": "public",
"public": true,
"type": "script",
"updatedAt": "2019-12-27T18:11:19.117Z",
"url": "https://val.town/v/tmcw/counter",
"version": 0
}
],
"links": {
"self": "https://example.com",
"next": "https://example.com",
"prev": "https://example.com"
}
}