> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SCJN Tesis Search

> Search Mexican Supreme Court case-law (tesis) from the SCJN's unified legal search. Covers the full Semanario Judicial corpus (300k+ tesis). Filter by binding force (`tesis_type`: jurisprudencia vs aislada), subject (materia), época number, and year. Results include highlighted snippets and `facets` listing the valid filter values with counts; drill into one with `scjn-tesis`.



## OpenAPI

````yaml /api-reference/openapi.json post /mx/scjn/tesis-search/v1
openapi: 3.1.0
info:
  title: Croma Marketplace API
  version: 1.0.0
  description: >-
    Government-data APIs for Colombia, Peru, Mexico, and global web search.
    Croma normalizes public-sector data into structured JSON for product teams
    and AI agents.
servers:
  - url: https://api.croma.run
security: []
paths:
  /mx/scjn/tesis-search/v1:
    post:
      tags:
        - Mexico
        - SCJN
      summary: SCJN Tesis Search
      description: >-
        Search Mexican Supreme Court case-law (tesis) from the SCJN's unified
        legal search. Covers the full Semanario Judicial corpus (300k+ tesis).
        Filter by binding force (`tesis_type`: jurisprudencia vs aislada),
        subject (materia), época number, and year. Results include highlighted
        snippets and `facets` listing the valid filter values with counts; drill
        into one with `scjn-tesis`.
      operationId: scjn_tesis_search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  minLength: 2
                  maxLength: 300
                  description: Search terms for tesis and jurisprudencia.
                tesis_type:
                  type: string
                  enum:
                    - any
                    - jurisprudencia
                    - aislada
                  default: any
                  description: >-
                    Filter by tesis type: binding `jurisprudencia`, non-binding
                    `aislada`, or `any`.
                subject:
                  type: string
                  maxLength: 60
                  default: ''
                  description: Optional subject filter (e.g. `Civil`, `Constitucional`).
                epoch:
                  type: string
                  default: ''
                  description: Optional época number filter (`5` through `12`).
                year:
                  type: string
                  default: ''
                  description: Optional 4-digit year filter.
                page:
                  type: integer
                  minimum: 1
                  maximum: 1000
                  default: 1
                  description: 1-based page number for paginated results.
                per_page:
                  type: integer
                  minimum: 1
                  maximum: 50
                  default: 20
                  description: Results per page.
              additionalProperties: false
            example:
              query: interés usurario
              tesis_type: jurisprudencia
      responses:
        '200':
          description: Successful response
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left before you are throttled.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: ISO 8601 timestamp when the window resets.
              schema:
                type: string
                format: date-time
            X-Cache:
              description: HIT or MISS. Cached hits still count against your quota.
              schema:
                type: string
                enum:
                  - HIT
                  - MISS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScjnTesisSearchResponse'
        '400':
          description: Invalid request body
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid API key
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left before you are throttled.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: ISO 8601 timestamp when the window resets.
              schema:
                type: string
                format: date-time
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal error
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '502':
          description: Upstream source returned an error
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      externalDocs:
        description: Interactive documentation and examples
        url: https://docs.usecroma.com/guides/mexico/scjn
components:
  schemas:
    ScjnTesisSearchResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - query
            - total
            - total_pages
            - page
            - per_page
            - count
            - results
            - facets
          properties:
            query:
              type: string
            total:
              type: integer
            total_pages:
              type: integer
            page:
              type: integer
            per_page:
              type: integer
            count:
              type: integer
            results:
              type: array
              items:
                $ref: '#/components/schemas/ScjnTesisSummary'
            facets:
              type: object
              required:
                - tesis_type
                - subject
                - epoch
                - year
              description: >-
                Valid values (with hit counts) for each filter, computed over
                the current query. Use these exact strings when filtering.
              properties:
                tesis_type:
                  $ref: '#/components/schemas/ScjnSearchFacetValues'
                subject:
                  $ref: '#/components/schemas/ScjnSearchFacetValues'
                epoch:
                  $ref: '#/components/schemas/ScjnSearchFacetValues'
                year:
                  $ref: '#/components/schemas/ScjnSearchFacetValues'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              description: >-
                Broad category: invalid_request_error, authentication_error,
                not_found_error, rate_limit_error, upstream_error, api_error.
            code:
              type: string
              description: Machine-readable specific code.
            message:
              type: string
              description: Human-readable explanation, safe to surface in UI.
            param:
              type: string
              description: Field that triggered the error. Present on validation errors.
            details:
              type: object
              description: Free-form structured detail.
    ScjnTesisSummary:
      type: object
      required:
        - registration_number
        - title
        - type
        - citation
        - epoch
        - instance
        - court
        - source
        - subjects
        - year
        - location
        - snippets
      properties:
        registration_number:
          type: string
        title:
          type: string
        type:
          type:
            - string
            - 'null'
          enum:
            - jurisprudencia
            - aislada
            - null
          description: 'Binding force: `jurisprudencia` is binding, `aislada` is not.'
        citation:
          type:
            - string
            - 'null'
          description: Official citation key, e.g. `1a./J. 132/2012 (10a.)`.
        epoch:
          type:
            - string
            - 'null'
        instance:
          type:
            - string
            - 'null'
        court:
          type:
            - string
            - 'null'
        source:
          type:
            - string
            - 'null'
        subjects:
          type: array
          items:
            type: string
        year:
          type:
            - integer
            - 'null'
        location:
          oneOf:
            - $ref: '#/components/schemas/ScjnTesisLocation'
            - type: 'null'
        snippets:
          type: array
          items:
            type: string
          description: >-
            Highlighted match fragments (keeps the `<em class='extracto'>`
            markup).
    ScjnSearchFacetValues:
      type: array
      items:
        type: object
        required:
          - value
          - count
        properties:
          value:
            type: string
          count:
            type:
              - integer
              - 'null'
    ScjnTesisLocation:
      type: object
      required:
        - book
        - volume
        - page
        - month
        - year
      description: Where the tesis was published inside the Semanario Judicial.
      properties:
        book:
          type:
            - string
            - 'null'
        volume:
          type:
            - string
            - 'null'
        page:
          type:
            - integer
            - 'null'
        month:
          type:
            - integer
            - 'null'
        year:
          type:
            - integer
            - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use Authorization: Bearer YOUR_API_KEY'

````