> ## Documentation Index
> Fetch the complete documentation index at: https://docs.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding the Metadata Query API and Search API

<div className="article_labels_list" style={{display: 'none'}} dangerouslySetInnerHTML={{__html: "Overview , Admin , Box Platform , Article , Product Utilization , Established , P1"}} />

The Box Metadata API enables you to programmatically find content on the basis of Box metadata. Using the Metadata API, you can:

* pass a set of parameters and conditions in a structure similar to a traditional SQL query, and
* get matching files and folders along with the corresponding metadata.

The Metadata Query API complements the Search API.

## Using the Metadata API

Use the Metadata Query API when you want to:

* find content based on Box metadata and not document content,
* use SQL-like logic to find content.

The Metadata Query API provides the ability to find content based on values stored in custom metadata. The structure of a metadata query is similar to that of an SQL query, and should feel familiar to anyone with SQL experience. The Metadata Query API enables you to write a query against a metadata template using boolean operators -- for example, AND, OR, and NOT -- as well as comparison and range operators -- such as equal to, greater than, less than -- and get results almost instantaneously.

A major benefit of the Metadata Query API is that results reflect metadata creations, updates, and immediate deletions. And no indexing delay occurs as with the Search API. The Metadata Query API also isn't limited on the number of characters that are queryable -- just the limits of the metadata instance size itself.

Unlike the Search API, however, the Metadata Query API does not support the "enterprise\_content" scope. A metadata query returns results only for content to which you have Collaborator access.

For more information on metadata querying and indexes, see the [developer documentation](https://developer.box.com/guides/metadata/queries/).

## Using the Search API

Use the Search API when you want:

* fuzzy matching,
* results based on document text and metadata,
* enterprise-wide search.

You can use the Search API to primarily search by file or folder names, as well as the corresponding document text, to find the most relevant results. And while you can use the Search API to search for and filter results based on metadata criteria, these searches are limited to simple boolean searches, for example, "field" = "value".

As with searches on file name or document text, metadata searches are technically "fuzzy" searches. This means that searching may return results that don't contain the exact term you have searched for.

The Box Search API relies on indexing, which is a process that happens whenever you upload or modify content or metadata. Indexing allows the Search API to find your content more easily, but with some limitations:

* The supported operations for metadata filters are limited. The Search API doesn't perform comparisons on multiple metadata fields.

If you're an administrator, you can search using the "enterprise\_content" scope. This means that even if you don't have access to view the file, you're still able to get the file information for processes such as eDiscovery.

## Metadata Query versus Search scenarios

With both these tools at your disposal, you can choose which to use and when.

Here are a few situations illustrating when to use the Search API, and when to use the Metadata Query API.

| Scenario | Which to use |
| - | - |
| You want to find all content in an enterprise with document text or metadata that matches the keyword "Guarantee" for eDiscovery. | **Search API** -- the Search API matches terms in both content and metadata, and can be scoped to all content in the enterprise. |
| You want to find all documents with the metadata template "Contract" that have a value greater than \$100,000, a renewal date in 2025, and are associated with the North America sales region. | **Metadata Query** -- with a metadata query, you can write boolean expressions that evaluate multiple fields in a template, such as a number, date, and string. |
| You want to find all documents with the metadata template "Contract" that have a value greater than \$100,000, a renewal date in 2025, are associated with the North American sales region, and contain the term "Acme" in the file name or document text. | **Not supported** -- you cannot mix both fuzzy search (the document contains the term "Acme") and the boolean expression matching metadata fields. |
