JavaScript
const options = { method: 'POST', headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'}, body: JSON.stringify({ query: 'What is photosynthesis?', topK: 5, materialIds: ['<string>'], folderIds: ['<string>'] }) }; fetch('https://studyfetchapi.com/api/v1/materials/search', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
{ "query": "<string>", "results": [ { "score": 123, "text": "<string>", "chunkIndex": 123, "material": { "id": "<string>", "name": "<string>", "contentType": "<string>" } } ], "totalResults": 123, "filtered": true, "scope": { "materialIds": [ "<string>" ], "folderIds": [ "<string>" ] } }
API Key for authentication
Search query
"What is photosynthesis?"
Number of results to return
Limit search to specific material IDs
Limit search to materials within specific folders (includes subfolders)
Search completed successfully
Original search query
Search results
Show child attributes
Relevance score (0-1)
Matched text chunk
Chunk index within the material
Material information
Total number of results
Whether results were filtered by scope
Search scope
Was this page helpful?