Asset Search
client.search.assetSearch(SearchAssetSearchParams { originalAssets, filter, hitsPerPage, 10 more } params, RequestOptionsoptions?): SearchHitsOffset<SearchAssetSearchResponse { id, authorId, collectionIds, 14 more } >
POST/search/assets
Search for assets.
At least one of the following fields must have a value: query, filter, image, or images.
image, images are mutually exclusive.
Asset Search
import Scenario from '@scenario-labs/sdk';
const client = new Scenario({
apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const searchAssetSearchResponse of client.search.assetSearch()) {
console.log(searchAssetSearchResponse.id);
}{
"hits": [
{
"id": "id",
"authorId": "authorId",
"collectionIds": [
"string"
],
"createdAt": "createdAt",
"metadata": {
"aspectRatio": "aspectRatio",
"baseModelId": "baseModelId",
"guidance": 0,
"height": 0,
"kind": "kind",
"modelId": "modelId",
"modelType": "modelType",
"name": "name",
"negativePrompt": "negativePrompt",
"negativePromptStrength": 0,
"numInferenceSteps": 0,
"parentJobId": "parentJobId",
"prompt": "prompt",
"scheduler": "scheduler",
"seed": "seed",
"size": 0,
"text": "text",
"thumbnail": {
"assetId": "assetId"
},
"type": "type",
"width": 0
},
"mimeType": "mimeType",
"nsfw": [
"string"
],
"ownerId": "ownerId",
"privacy": "privacy",
"tags": [
"string"
],
"teamId": "teamId",
"updatedAt": "updatedAt",
"url": "url",
"description": "description",
"score": 0,
"thumbnail": {
"assetId": "assetId",
"url": "url"
},
"transcription": "transcription"
}
],
"limit": 0,
"offset": 0,
"estimatedTotalHits": 0,
"hitsPerPage": 0,
"page": 0,
"totalHits": 0,
"totalPages": 0
}Returns Examples
{
"hits": [
{
"id": "id",
"authorId": "authorId",
"collectionIds": [
"string"
],
"createdAt": "createdAt",
"metadata": {
"aspectRatio": "aspectRatio",
"baseModelId": "baseModelId",
"guidance": 0,
"height": 0,
"kind": "kind",
"modelId": "modelId",
"modelType": "modelType",
"name": "name",
"negativePrompt": "negativePrompt",
"negativePromptStrength": 0,
"numInferenceSteps": 0,
"parentJobId": "parentJobId",
"prompt": "prompt",
"scheduler": "scheduler",
"seed": "seed",
"size": 0,
"text": "text",
"thumbnail": {
"assetId": "assetId"
},
"type": "type",
"width": 0
},
"mimeType": "mimeType",
"nsfw": [
"string"
],
"ownerId": "ownerId",
"privacy": "privacy",
"tags": [
"string"
],
"teamId": "teamId",
"updatedAt": "updatedAt",
"url": "url",
"description": "description",
"score": 0,
"thumbnail": {
"assetId": "assetId",
"url": "url"
},
"transcription": "transcription"
}
],
"limit": 0,
"offset": 0,
"estimatedTotalHits": 0,
"hitsPerPage": 0,
"page": 0,
"totalHits": 0,
"totalPages": 0
}