---
updatedAt: 2026-10-01T17:11:41.000Z
agentTools:
  projectIndex: https://docs.sensible.so/llms.txt
---

# Anchor object

How the Anchor object works in Sensible, including its parameters, simple and complex syntax, and how it locates data.

An *anchor* is a string, [Match](https://docs.sensible.so/docs/match) object, or array of Match objects.

An anchor's behavior depends on its field's method:

| Category             | Required? | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Layout-based methods | required  | An anchor is a computationally quick way to narrow down the rough location of the data you want to extract in a document. After locating the anchor, Sensible uses a layout-based ["method"](https://docs.sensible.so/docs/method) to spatially expand out from the anchor and extract the data you want.                                                                                                                                                            |
| LLM-based methods    | optional  | An anchor is a test for running a field or skipping it:<br/>- If the anchor is present in the document, Sensible searches the whole document for the target data.<br/>- If the anchor is missing, Sensible returns null for the field.<br/>You can use this behavior to define backup, or  "[fallback](https://docs.sensible.so/docs/fallbacks)", fields.<br/> For an exception to this behavior, see the [Multimodal Engine](https://docs.sensible.so/docs/query-group#parameters) parameter. |

[**Parameters**](https://docs.sensible.so/docs/anchor#parameters)\
[**Examples**](https://docs.sensible.so/docs/anchor#examples)\
[**Notes**](https://docs.sensible.so/docs/anchor#notes)

Define anchors using simple or complex syntax. The following example shows simple syntax:

```json
{
  "fields": [
    {
      "id": "simple_label",
      "anchor": "this is a string to anchor on",
      "method": {
        "id": "label",
        "position": "below"
      }
    }
  ]
} 
```

Behind the scenes, Sensible expands string anchors to case-insensitive `includes` matches. For example, Sensible automatically expands the preceding example as:

```json
      "anchor": {
        "match": {
          "type": "includes",
          "text": "this is a string to anchor on",
        }
      },
```

## Parameters

An Anchor object has the following top-level parameters:

| key                                             | value                                       | description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| match (**required**, except for string anchors) | Match object or array of Match objects      | See [Match object](https://docs.sensible.so/docs/match).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| start                                           | string, Match object, or Match object array | Starts the search for the anchor's Match parameter and for its End parameter at a line of text in the document, and ignores all the text that precedes the start line. <br/> The terms "preceding" and "succeeding" primarily mean *above* and *below* the Start line, respectively. For more information, see [Line sorting](https://docs.sensible.so/docs/lines#line-sorting).<br/>You can extract anchor output with the [Passthrough method](https://docs.sensible.so/docs/passthrough).                                                                                                                         |
| end                                             | string, Match, or Match array               | Stops the search for the anchor's Match parameter before a line of text in the document. Ignores the End line and all the text that succeeds the End line. <br/> The terms "preceding" and "succeeding" primarily mean *above* and *below* the End line, respectively. For more information, see [Line sorting](https://docs.sensible.so/docs/lines#line-sorting).<br/>If unspecified, the anchor searches for matches to the end of the document.<br/>If you specify a Start line, Sensible searches for the End line starting at the Start line instead of at the start of the document. |
| includeEnd                                      | boolean. default: false                     | Whether to include or ignore the End line in the search for the anchor's Match parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

## Examples

Here's an example of an Anchor object that uses all these parameters:

```json
{
  "fields": [
    {
      "id": "simple_label",
      "anchor": { /* required for layout methods. for LLM methods, acts as an optional run/skip check */
        "start": "My section heading. Start matching at the start of this line", /* optional. ignore everything before this line */
        "end": "My footer text. Stop matching before it", /* optional. stop searching at this line */
        "includeEnd": true, /* default: false. if true, include the end line in the match search */
        "match": /* locates the anchor line. accepts a single Match object or an array of Match objects */
          [
            {
              "type": "includes", /* equals | startsWith | endsWith | includes | regex | first | any | all | not */
              "text": "Only finds anchor if you match this string in a line that is between the start and end lines",
              "isCaseSensitive": false, /* default: false */
            },
          ]      
      },
      "method": {
        "id": "label",
        "position": "below"
      }
    }
  ]
}
```

# Notes

For information about complex anchor syntax, see [Anchor variables](https://docs.sensible.so/docs/anchor-nuances) and .[Match arrays](https://docs.sensible.so/docs/match-arrays).