Skip to main content
POST
/
v3
/
search
Search documents
const url = 'https://api.supermemory.ai/v3/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"q":"machine learning concepts"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "results": [
    {
      "chunks": [
        {
          "content": "Machine learning is a subset of artificial intelligence...",
          "isRelevant": true,
          "score": 0.85
        }
      ],
      "createdAt": "1970-01-01T00:00:00.000Z",
      "documentId": "doc_xyz789",
      "metadata": {
        "category": "technology",
        "isPublic": true,
        "readingTime": 5,
        "source": "web",
        "tag_1": "ai",
        "tag_2": "machine-learning"
      },
      "score": 0.95,
      "summary": "A comprehensive guide to understanding the basics of machine learning and its applications.",
      "content": "This is the complete content of the document about machine learning concepts...",
      "title": "Introduction to Machine Learning",
      "updatedAt": "1970-01-01T00:00:00.000Z",
      "type": "web"
    }
  ],
  "timing": 123,
  "total": 123
}

Authorizations

Authorization
string
header
required

Body

application/json
q
string
required
Minimum length: 1
Example:
chunkThreshold
number
default:0
Required range: 0 <= x <= 1
Example:
containerTags
string[]
Example:
docId
string
Maximum length: 255
documentThreshold
number
default:0
deprecated
Required range: 0 <= x <= 1
filters
object
  • Option 1
  • Option 2
includeFullDocs
boolean
default:false
Example:
includeSummary
boolean
default:false
limit
integer
default:10
Required range: 1 <= x <= 100
Example:
onlyMatchingChunks
boolean
default:true
rerank
boolean
default:false
Example:
rewriteQuery
boolean
default:false
Example:
categoriesFilter
string[]
deprecated

Response

results
object[]
required
timing
number
required
total
number
required