---
updatedAt: 2026-06-02T06:51:34.000Z
agentTools:
  projectIndex: https://developers.sefaria.org/llms.txt
---

# Find Refs

Initially designed to find links on websites using [Sefaria's Linker](https://www.sefaria.org/linker), the Find Refs API can identify textual references in any arbitrary text that gets sent to it via a structured POST request.

**This is an asynchronous API.** The endpoint immediately returns a `task_id` with HTTP 202. You must poll `GET /api/async/{task_id}` to retrieve the task status. When the task completes successfully, the `/api/async/{task_id}` response will include a `result` field containing the same `FindRefsAPIResponse` object described in the 200 response schema below.

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Sefaria API",
    "version": "1.0.0",
    "description": "The Sefaria API endpoints grant live access to Sefaria's structured database of Jewish texts and their interconnections.",
    "contact": {
      "url": "https://www.sefaria.org",
      "email": "developers@sefaria.org"
    },
    "license": {
      "name": "GNU AGPLv3",
      "url": "https://www.gnu.org/licenses/agpl.txt"
    }
  },
  "servers": [
    {
      "url": "https://www.sefaria.org",
      "description": ""
    }
  ],
  "tags": [
    {
      "name": "Misc",
      "description": "Miscellaneous API endpoints"
    }
  ],
  "paths": {
    "/api/find-refs": {
      "post": {
        "operationId": "post-find-refs",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FindRefsPOSTRequest"
              },
              "examples": {
                "Example": {
                  "value": {
                    "text": {
                      "body": "Genesis 1:1 is a citation and also Mishnah Peah 3-4. So is שמות ב",
                      "title": "Some thoughts on Sefer Bereishit 1"
                    },
                    "lang": "en"
                  }
                }
              }
            }
          },
          "required": true
        },
        "tags": [
          "Misc"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindRefsAPIResponse"
                }
              }
            },
            "description": "Shape of the `result` field returned by `GET /api/async/{task_id}` on successful completion."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncTaskEnqueued"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "task_id": "b3d9e1a2-4f7c-4e2b-9a1d-6c8e2f0d5b3a"
                    }
                  }
                }
              }
            },
            "description": "Task enqueued. Poll `GET /api/async/{task_id}` to retrieve results. When the task completes successfully, the result will have the shape described by `FindRefsAPIResponse`."
          }
        },
        "summary": "Find Refs",
        "description": "Initially designed to find links on websites using [Sefaria's Linker](https://www.sefaria.org/linker), the Find Refs API can identify textual references in any arbitrary text that gets sent to it via a structured POST request.\n\n**This is an asynchronous API.** The endpoint immediately returns a `task_id` with HTTP 202. You must poll `GET /api/async/{task_id}` to retrieve the task status. When the task completes successfully, the `/api/async/{task_id}` response will include a `result` field containing the same `FindRefsAPIResponse` object described in the 200 response schema below."
      }
    }
  },
  "components": {
    "schemas": {
      "ref": {
        "description": "A string representing a citation to a Jewish text. \n\nA valid `Ref` consists of a title string followed optionally by a section string or a segment string. \n\nA title string is any one of the known text titles or title variants in the Sefaria Database.",
        "type": "string",
        "example": "Mishnah Peah 4:2"
      },
      "FindRefsAPIResponse": {
        "title": "Root Type for FindRefsAPIResponse",
        "description": "A response to the Find Refs API",
        "type": "object",
        "properties": {
          "title": {
            "description": "Information about any references found in the `title` field of the POST request",
            "type": "object",
            "properties": {
              "results": {
                "type": "array",
                "items": {
                  "description": "A single matched reference",
                  "type": "object",
                  "properties": {
                    "startChar": {
                      "format": "int32",
                      "description": "The index of the starting character of the match",
                      "type": "integer"
                    },
                    "endChar": {
                      "format": "int32",
                      "description": "The index of the ending character of the match",
                      "type": "integer"
                    },
                    "text": {
                      "description": "The matched reference",
                      "type": "string"
                    },
                    "linkFailed": {
                      "type": "boolean"
                    },
                    "refs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ref"
                      }
                    }
                  }
                }
              },
              "refData": {
                "type": "object",
                "properties": {
                  "RefTitle": {
                    "type": "object",
                    "properties": {
                      "heRef": {
                        "description": "The Hebrew equivalent of the canonical ref",
                        "type": "string"
                      },
                      "url": {
                        "description": "The URL this ref can be found at on Sefaria",
                        "type": "string"
                      },
                      "primaryCategory": {
                        "description": "The primary category this ref belongs to on Sefaria",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "body": {
            "description": "Information about any references found in the `body` field of the POST request",
            "type": "object",
            "properties": {
              "results": {
                "type": "array",
                "items": {
                  "description": "A single matched reference",
                  "type": "object",
                  "properties": {
                    "startChar": {
                      "format": "int32",
                      "description": "The index of the starting character of the match",
                      "type": "integer"
                    },
                    "endChar": {
                      "format": "int32",
                      "description": "The index of the ending character of the match",
                      "type": "integer"
                    },
                    "text": {
                      "description": "The matched reference",
                      "type": "string"
                    },
                    "linkFailed": {
                      "type": "boolean"
                    },
                    "refs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ref"
                      }
                    }
                  }
                }
              },
              "refData": {
                "type": "object",
                "properties": {
                  "RefTitle": {
                    "type": "object",
                    "properties": {
                      "heRef": {
                        "description": "The Hebrew equivalent of the canonical ref",
                        "type": "string"
                      },
                      "url": {
                        "description": "The URL this ref can be found at on Sefaria",
                        "type": "string"
                      },
                      "primaryCategory": {
                        "description": "The primary category this ref belongs to on Sefaria",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "example": {
          "title": {
            "results": [
              {
                "startChar": 23,
                "endChar": 34,
                "text": "Bereishit 1",
                "linkFailed": false,
                "refs": [
                  "Genesis 1"
                ]
              }
            ],
            "refData": {
              "Genesis 1": {
                "heRef": "בראשית א׳",
                "url": "Genesis.1",
                "primaryCategory": "Tanakh"
              }
            }
          },
          "body": {
            "results": [
              {
                "startChar": 0,
                "endChar": 11,
                "text": "Genesis 1:1",
                "linkFailed": false,
                "refs": [
                  "Genesis 1:1"
                ]
              },
              {
                "startChar": 35,
                "endChar": 51,
                "text": "Mishnah Peah 3-4",
                "linkFailed": false,
                "refs": [
                  "Mishnah Peah 3-4"
                ]
              }
            ],
            "refData": {
              "Genesis 1:1": {
                "heRef": "בראשית א׳:א׳",
                "url": "Genesis.1.1",
                "primaryCategory": "Tanakh"
              },
              "Mishnah Peah 3-4": {
                "heRef": "משנה פאה ג׳-ד׳",
                "url": "Mishnah_Peah.3-4",
                "primaryCategory": "Mishnah"
              }
            }
          }
        }
      },
      "FindRefsPOSTRequest": {
        "title": "Root Type for FindRefsPOSTRequest",
        "description": "A properly formatted POST request for the Find Refs API",
        "required": [
          "lang",
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "description": "Initially designed for websites, this API expects the `text` field to contain both a `body` and a `title`. When parsing arbitrary text feel free to just use `body` and pass an empty string `''` to `title`",
            "type": "object",
            "properties": {
              "body": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            }
          },
          "lang": {
            "description": "Either `he` or `en`. If not included, it will default to one based on the number of Hebrew or Latin characters in the `body` of the `text`.",
            "enum": [
              "he",
              "en"
            ],
            "type": "string",
            "example": "en"
          }
        },
        "example": {
          "text": {
            "body": "Genesis 1:1 is a citation and also Mishnah Peah 3-4. So is שמות ב",
            "title": "Some thoughts on Sefer Bereishit 1"
          },
          "lang": "en"
        }
      },
      "AsyncTaskEnqueued": {
        "title": "Async Task Enqueued",
        "description": "Response returned when an asynchronous task has been successfully enqueued.",
        "type": "object",
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier for the enqueued task. Pass this to `GET /api/async/{task_id}` to poll for results."
          }
        },
        "example": {
          "task_id": "b3d9e1a2-4f7c-4e2b-9a1d-6c8e2f0d5b3a"
        }
      }
    }
  }
}
```