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

# Buscar matérias, cursos e docentes

> Reúne matérias e a primeira página de cursos e docentes. Com login, inclui os dados da matriz do aluno.



## OpenAPI

````yaml /mintlify/openapi.json get /public/search
openapi: 3.1.0
info:
  title: Followw UnB API
  description: >-
    API independente e open-source para consultar dados do SIGAA e de outros
    sistemas da UnB. O acesso autenticado usa a conta do SIGAA, com sessão por
    cookies.
  version: 0.1.0
servers:
  - url: https://api.followw.app
    description: Produção
  - url: http://localhost:8000
    description: Desenvolvimento local
security: []
tags:
  - name: Auth
    description: Login no SIGAA e sessão por cookies.
  - name: Classrooms
    description: Turmas, participantes, frequência e resultados acadêmicos.
  - name: Me
    description: Perfil, configurações, documentos e acesso ao RU.
  - name: Public Classrooms
    description: Turmas e unidades do SIGAA.
    x-displayName: Classrooms
  - name: Public Courses
    description: Cursos e currículos por ingresso.
    x-displayName: Courses
  - name: Public Professors
    description: Catálogo de docentes.
    x-displayName: Professors
  - name: Public Restaurant
    description: Cardápio do RU.
    x-displayName: Restaurant
  - name: Public Search
    description: Busca de matérias, cursos e docentes.
    x-displayName: Search
  - name: Public Subjects
    description: Matérias de graduação e suas turmas.
    x-displayName: Subjects
  - name: Posts
    description: Notícias e avaliações das turmas.
paths:
  /public/search:
    get:
      tags:
        - Public Search
      summary: Buscar matérias, cursos e docentes
      description: >-
        Reúne matérias e a primeira página de cursos e docentes. Com login,
        inclui os dados da matriz do aluno.
      operationId: search_public_search_get
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 3
            maxLength: 32
            pattern: ^[^\x00-\x1f\x7f]+$
            description: Termos da busca.
            title: Q
          description: Termos da busca.
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/SearchType'
              - type: 'null'
            description: Tipos buscados; repita o parâmetro para selecionar vários.
            title: Type
          description: Tipos buscados; repita o parâmetro para selecionar vários.
        - name: unit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 2147483647
                exclusiveMinimum: 0
              - type: string
                pattern: '[^0-9]'
              - type: 'null'
            description: ID ou sigla da unidade, para todos os tipos.
            title: Unit
          description: ID ou sigla da unidade, para todos os tipos.
        - name: Cache-Control
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              `no-cache`: revalidar; `max-age=N`: idade máxima em segundos;
              `stale-if-error[=N]`: aceitar cache na falha; `only-if-cached`:
              usar só cache (504 se ausente).
            title: Cache-Control
          description: >-
            `no-cache`: revalidar; `max-age=N`: idade máxima em segundos;
            `stale-if-error[=N]`: aceitar cache na falha; `only-if-cached`: usar
            só cache (504 se ausente).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResult'
        '422':
          description: Texto ou tipo inválido, ou unidade inexistente.
components:
  schemas:
    SearchType:
      type: string
      enum:
        - subjects
        - courses
        - professors
    SearchResult:
      properties:
        subjects:
          anyOf:
            - items:
                $ref: '#/components/schemas/CatalogSubject'
              type: array
            - type: 'null'
          title: Subjects
        courses:
          anyOf:
            - $ref: '#/components/schemas/CoursePage'
            - type: 'null'
        professors:
          anyOf:
            - $ref: '#/components/schemas/ProfessorPage'
            - type: 'null'
      type: object
      required:
        - subjects
        - courses
        - professors
      title: SearchResult
      description: Cada tipo no formato do seu endpoint; nulo quando não foi pedido.
    CatalogSubject:
      properties:
        curriculum_prerequisites:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        curriculum_corequisites:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        offered_equivalences:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        code:
          type: string
          title: Code
        name:
          type: string
          title: Name
        hours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Hours
        unit:
          anyOf:
            - $ref: '#/components/schemas/UnitRef'
            - type: 'null'
        prerequisites:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        corequisites:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        equivalences:
          anyOf:
            - $ref: '#/components/schemas/CatalogRequirements'
            - type: 'null'
        classrooms:
          items:
            $ref: '#/components/schemas/SubjectClassroom'
          type: array
          title: Classrooms
        kind:
          anyOf:
            - type: string
              enum:
                - mandatory
                - optional
                - free
            - type: 'null'
          title: Kind
        unlocks:
          items:
            $ref: '#/components/schemas/SubjectReference'
          type: array
          title: Unlocks
        curriculum_period:
          anyOf:
            - type: integer
            - type: 'null'
          title: Curriculum Period
        recommendation:
          anyOf:
            - $ref: '#/components/schemas/SubjectRecommendation'
            - type: 'null'
      type: object
      required:
        - code
        - name
        - classrooms
      title: CatalogSubject
      description: O componente com as turmas do semestre consultado e os requisitos.
    CoursePage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PublicCourse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
      type: object
      required:
        - items
        - total
        - page
        - page_size
      title: CoursePage
    ProfessorPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ProfessorItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
      type: object
      required:
        - items
        - total
        - page
        - page_size
      title: ProfessorPage
    CatalogRequirements:
      items:
        items:
          $ref: '#/components/schemas/SubjectRequirement'
        type: array
      type: array
    UnitRef:
      properties:
        id:
          type: integer
          title: Id
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - code
        - name
      title: UnitRef
      description: 'Unidade acadêmica: `id` do SIGAA e sigla em `code`.'
    SubjectClassroom:
      properties:
        professors:
          items:
            $ref: '#/components/schemas/ProfessorRef'
          type: array
          title: Professors
          default: []
        vacancies:
          anyOf:
            - type: integer
            - type: 'null'
          title: Vacancies
          description: Vagas na última coleta, sem atualização em tempo real.
        occupied:
          anyOf:
            - type: integer
            - type: 'null'
          title: Occupied
          description: Ocupação na última coleta, sem atualização em tempo real.
        sigaa_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sigaa Id
        number:
          type: string
          title: Number
        semester:
          type: string
          title: Semester
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
        room:
          anyOf:
            - type: string
            - type: 'null'
          title: Room
      type: object
      required:
        - number
        - semester
      title: SubjectClassroom
    SubjectReference:
      properties:
        code:
          type: string
          title: Code
        name:
          type: string
          title: Name
      type: object
      required:
        - code
        - name
      title: SubjectReference
    SubjectRecommendation:
      properties:
        reasons:
          items:
            $ref: '#/components/schemas/SubjectReason'
          type: array
          title: Reasons
      type: object
      required:
        - reasons
      title: SubjectRecommendation
      description: Motivos da posição no ranking, do mais ao menos relevante.
    PublicCourse:
      properties:
        id:
          type: integer
          title: Id
        sigaa_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sigaa Id
        name:
          type: string
          title: Name
        shift:
          anyOf:
            - type: string
            - type: 'null'
          title: Shift
        unit:
          $ref: '#/components/schemas/UnitRef'
        level:
          anyOf:
            - type: string
              const: Graduação
            - type: 'null'
          title: Level
      type: object
      required:
        - id
        - sigaa_id
        - name
        - shift
        - unit
        - level
      title: PublicCourse
    ProfessorItem:
      properties:
        siape:
          type: integer
          title: Siape
        name:
          type: string
          title: Name
        unit:
          $ref: '#/components/schemas/UnitRef'
        photo:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo
        url:
          type: string
          title: Url
      type: object
      required:
        - siape
        - name
        - unit
        - photo
        - url
      title: ProfessorItem
    SubjectRequirement:
      properties:
        code:
          type: string
          title: Code
        subject:
          anyOf:
            - $ref: '#/components/schemas/SubjectReference'
            - type: 'null'
      type: object
      required:
        - code
      title: SubjectRequirement
    ProfessorRef:
      properties:
        siape:
          anyOf:
            - type: integer
            - type: 'null'
          title: Siape
        name:
          type: string
          title: Name
        photo:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
      type: object
      required:
        - siape
        - name
        - photo
        - email
      title: ProfessorRef
      description: Docente da turma; `siape` nulo fora do catálogo.
    SubjectReason:
      properties:
        code:
          $ref: '#/components/schemas/ReasonCode'
        value:
          anyOf:
            - type: integer
            - type: 'null'
          title: Value
      type: object
      required:
        - code
      title: SubjectReason
    ReasonCode:
      type: string
      enum:
        - required
        - target_period
        - overdue
        - same_unit
        - chain_length
        - chain_width
        - hours

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.