---
updatedAt: 2026-05-12T09:57:32.000Z
agentTools:
  projectIndex: https://developers.sefaria.org/llms.txt
---

# Link Summary

Returns a summary of all links targeting a ref, grouped by category, with per-book breakdowns.

# 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": "Related",
      "description": "Operations related to retrieving links and relationships between texts"
    }
  ],
  "paths": {
    "/api/link-summary/{ref}": {
      "summary": "Link Summary",
      "description": "Returns a summary of all links targeting a ref, grouped by category, with per-book breakdowns.",
      "get": {
        "operationId": "get-link-summary",
        "tags": [
          "Related"
        ],
        "parameters": [
          {
            "name": "ref",
            "description": "Sefaria ref, e.g. `Mishnah Peah 2:1`. A Sefaria ref is a human-readable text citation, e.g. `Genesis 1:1`, `Berakhot 2a`, or `Rashi on Genesis 1:1`.",
            "schema": {
              "type": "string",
              "default": "Mishnah_Peah.2.1"
            },
            "in": "path",
            "required": true,
            "examples": {
              "Mishnah Peah 2:1": {
                "value": "Mishnah_Peah.2.1"
              }
            }
          }
        ],
        "description": "Returns a summary of all links targeting a ref, grouped by category, with per-book breakdowns.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LinkSummaryJSON"
                  }
                },
                "examples": {
                  "Mishnah Peah 2:1": {
                    "value": [
                      {
                        "name": "Commentary",
                        "count": 133,
                        "books": {
                          "Tosefot Yom Tov on Mishnah Peah": 7,
                          "Rambam on Mishnah Peah": 8,
                          "Rash MiShantz on Mishnah Peah": 9,
                          "Bartenura on Mishnah Peah": 11,
                          "Yachin on Mishnah Peah": 13,
                          "Melekhet Shelomoh on Mishnah Peah": 6
                        }
                      },
                      {
                        "name": "Midrash",
                        "count": 1,
                        "books": {
                          "Sifra, Kedoshim, Chapter 2": 1
                        }
                      }
                    ]
                  }
                }
              }
            },
            "description": "Successful Response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LinkSummaryJSON": {
        "title": "Root Type for LinkSummaryJSON",
        "description": "Single category bucket from a link summary.",
        "type": "object",
        "properties": {
          "name": {
            "description": "Category name.",
            "type": "string"
          },
          "count": {
            "description": "Total links in this category.",
            "type": "integer"
          },
          "books": {
            "description": "Per-book breakdown within the category, keyed by book title. Each value is the number of links from that book.",
            "type": "object"
          }
        }
      }
    }
  }
}
```