API

ETSO provides a public API for querying catalogue work metadata from other projects. The API is designed to reuse identifiers, titles, attributions, links, and the stylometric result for each work.

The information is returned as JSON and can be used to integrate ETSO data into catalogues, visualizations, search engines, or research tools.

Endpoints

GET /api/obras

Returns the complete work catalogue with its public metadata.

GET /api/obras/{id-o-slug}

Returns a single work using its identifier or public slug.

Main Fields

FieldDescription
idStable work identifier.
slugReadable identifier used in public URLs.
titleTitle as stored in the database, including the final article when present.
displayTitleTitle transformed with the same process used by the ETSO website.
titleVariantsOther work titles as stored in the database.
displayTitleVariantsOther titles transformed with the same process used by the website.
genreWork genre.
originSource or provenance of the text used by ETSO.
textStateText state in the catalogue.
addedOnDate added to the catalogue, when available.
resultado1Stylometric result for the work as a sentence.
flagsBoolean indicators for report, summary, authorship exam, and text access.
traditionalAttributionTextTraditional attribution ready for display.
traditionalAttributionPhraseTraditional attribution sentence with text, Markdown, HTML, and linkable parts.
stylometryAttributionTextStylometric attribution ready for display.
traditionalAttributionNormalized traditional attribution.
stylometryAttributionNormalized stylometric attribution.
resourcesRelated public links within ETSO.

Recommended Use

Responses are served with public cache: public, max-age=3600, s-maxage=86400, stale-while-revalidate=604800. For external integrations, cache the response locally and avoid calling the API on every render.

Example

Query for a specific work and complete response:

https://etso.es/api/obras/la-francesa-laura
{
  "meta": {
    "contentPolicy": {
      "includesFullText": false,
      "includesSummaries": false,
      "excludedFields": [
        "fullText",
        "text",
        "shortSummary",
        "summaryText",
        "resumen_breve",
        "resumen_largo"
      ]
    }
  },
  "work": {
    "id": "DESCONOCIDO_FrancesaLaura",
    "slug": "la-francesa-laura",
    "title": "Francesa Laura, La",
    "displayTitle": "La francesa Laura",
    "titleVariants": [],
    "displayTitleVariants": [],
    "genre": "Comedia",
    "origin": "El texto procede de la edición de Cuéllar y Vega.",
    "textState": "Bueno",
    "addedOn": "2021/03",
    "resultado1": "Los analisis de estilometria permiten asociar esta obra de forma clara con el perfil autorial de Lope de Vega Carpio.",
    "flags": {
      "inAuthorshipExam": true,
      "hasSummary": true,
      "hasReport": true,
      "hasTextAccess": true
    },
    "traditionalAttributionText": "Unknown author",
    "traditionalAttributionPhrase": {
      "text": "Work of unknown attribution.",
      "markdown": "Work of [unknown attribution](https://etso.es/autores/desconocido).",
      "html": "Work of <a href=\"/autores/desconocido\">unknown attribution</a>.",
      "parts": [
        {
          "kind": "text",
          "value": "Work of "
        },
        {
          "kind": "author",
          "value": "unknown attribution",
          "authorId": "desconocido",
          "href": "/autores/desconocido",
          "url": "https://etso.es/autores/desconocido"
        },
        {
          "kind": "text",
          "value": "."
        }
      ]
    },
    "stylometryAttributionText": "Lope de Vega Carpio [Secure]",
    "traditionalAttribution": {
      "groups": [
        {
          "members": [
            {
              "authorId": "desconocido",
              "authorName": "Unknown author"
            }
          ]
        }
      ],
      "connector": "and",
      "rawExpression": "desconocido"
    },
    "stylometryAttribution": {
      "groups": [
        {
          "members": [
            {
              "authorId": "vega_carpio_lope_de",
              "authorName": "Lope de Vega Carpio",
              "confidence": "segura"
            }
          ]
        }
      ],
      "connector": "and",
      "rawExpression": "vega_carpio_lope_de[segura]"
    },
    "resources": {
      "work": "/obras/la-francesa-laura",
      "summary": "/obras/la-francesa-laura/resumen",
      "report": "/informes/analisis-estilometrico-la-francesa-laura",
      "textAccess": [
        {
          "label": "Text BITESO",
          "href": "/biteso/francesa-laura-la",
          "kind": "biteso"
        }
      ]
    }
  }
}