Misc

Category

GET requests take a full category path in the request, e.g. /api/category/Tanakh/Torah/Genesis, and return the full category object found.

If the category is not found, the returned object will have an error attribute. If any element of the path is found, the API will return the closest parent in an attribute called closest_parent. This is useful for proactively looking up a category before posting an Index to it.

get/api/category/{category_path}

Request

  • Base URL
    https://www.sefaria.org
  • URL
    https://www.sefaria.org/api/category/{category_path}
  • Auth
    none declared

Response

GET requests take a full category path in the request, e.g. /api/category/Tanakh/Torah/Genesis, and return the full category object found.

If the category is not found, the returned object will have an error attribute. If any element of the path is found, the API will return the closest parent in an attribute called closest_parent. This is useful for proactively looking up a category before posting an Index to it.

pathstring[]

The full path of the category

lastPathstring

The immediate parent of the current category. So for example, with the category Tanakh/Torah/Genesis, the lastPath is Torah.

Example response

{
  "path": [
    "Tanakh",
    "Torah"
  ],
  "titles": [
    {
      "lang": "en",
      "text": "Torah",
      "primary": true
    },
    {
      "lang": "he",
      "text": "תורה",
      "primary": true
    }
  ],
  "lastPath": "Torah"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.