University of Gothenburg Analysis API

### Queries for Annotating Texts The default query for the text analysis can be sent as GET or POST requests. The latter can be useful for longer texts. In both cases the response is a JSON object containing the text analysis in XML format. See [Default query](#tag/Analysis/paths/~1/get) for more details. It is also possible to upload text or XML files. In this case the response is a JSON object with a download link to a zip file containing the annotation. See [File upload](#tag/Files/paths/~1upload/post) for more details. ### Settings The web service supports some custom settings, e.g. it lets you choose between different tokenizers on word, sentence, and paragraph level and you can define which annotations should be generated. Via the settings you can also choose the language of your input and you can define whether your input is in XML or plain text. These settings are provided as a JSON object to the `settings` parameter. This object must satisfy the JSON schema that is generated by `/schema` call when provided with a `language` and a `mode` parameter: [`/schema?language=sv&mode=plain`](https://ws.spraakbanken.gu.se/ws/sparv/v3/schema?language=sv&mode=plain) The schema holds default values for all the attributes. The use of the settings parameter is therefore optional. This is an example for a request which only generates a dependency analysis: [`/?text=Det+trodde+jag+aldrig.&settings={"positional_attributes":{"dependency_attributes":["ref","dephead","deprel"],"lexical_attributes":[],"compound_attributes":[]}}`](https://ws.spraakbanken.gu.se/ws/sparv/v3/?text=Det+trodde+jag+aldrig.&settings={"positional_attributes":{"dependency_attributes":["ref","dephead","deprel"],"lexical_attributes":[],"compound_attributes":[]}}) If you are not sure how to define the settings parameter you can get help from the [frontend](https://spraakbanken.gu.se/sparv) by clicking `Show JSON Settings` under `Show advanced settings`. This will generate the JSON object for the chosen settings which is sent in the `settings` parameter. ### Analysing other Languages The default analysis language is Swedish but Sparv also supports other languages. The language is specified by supplying a two-letter ISO 639-1 code to the `language` parameter. This is an example for an analysis of a German sentence: [`/?text=Nun+folgt+ein+deutscher+Beispielsatz.&language=de`](https://ws.spraakbanken.gu.se/ws/sparv/v3/?text=Nun+folgt+ein+deutscher+Beispielsatz.&language=de) Different kinds of settings are supported for different languages, depending on which tool is used for the analysis. Please use the [frontend](https://spraakbanken.gu.se/sparv) if you want to check what options there are for a certain language. Alternatively you can check the JSON schema for the language you want to analyse by sending a schema request, e.g.: [`/schema?language=de`](https://ws.spraakbanken.gu.se/ws/sparv/v3/schema?language=de) [This language table](https://spraakbanken.gu.se/eng/research/infrastructure/sparv/distribution/pipeline#language_table) provides information on which languages are currently supported and which tools are used for their analysis.

Operations 5

GET / Default query #
POST / Default query #
GET /schema Schema #
GET /makefile Makefile #
GET /join Join #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/university-of-gothenburg-analysis-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

university-of-gothenburg-analysis-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sparv Analysis API
  description: 'Sparv is Språkbanken’s annotation tool and contains a corpus import pipeline

    and a web service including a web interface.

    It can be used to annotate shorter texts using the same tools as are applied

    in the annotation of the corpora in Korp and the texts in

    Strix.


    You can read more about Sparv on Språkbanken''s web page.'
  x-logo:
    url: https://ws.spraakbanken.gu.se/ws/sparv/v3/static/sparv_frame.png
  contact:
    name: Språkbanken
    url: https://spraakbanken.gu.se/
    email: sb-info@svenska.gu.se
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '3.0'
servers:
- url: https://ws.spraakbanken.gu.se/ws/sparv/v3
  description: Production server
- url: https://ws.spraakbanken.gu.se/ws/sparvlabb/v3
  description: Lab version
tags:
- name: Analysis
  description: '### Queries for Annotating Texts


    The default query for the text analysis can be sent as GET or POST requests.'
paths:
  /:
    get:
      tags:
      - Analysis
      summary: Default query
      description: 'When provided with the text parameter this call handles text input and runs the Sparv analysis.


        ### Example


        `/?text=En+exempelmening+till+nättjänsten`'
      parameters:
      - name: text
        in: query
        required: true
        description: The text to be analysed
        schema:
          type: string
      - $ref: '#/components/parameters/ModeParam'
      - $ref: '#/components/parameters/IncrementalParam'
      - $ref: '#/components/parameters/LanguageParam'
      - $ref: '#/components/parameters/SettingsParam'
      responses:
        '200':
          description: Text analysis in XML
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisSchema'
        '500':
          description: Failed to run analysis
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
      operationId: getRoot
      x-operation-id-source: derived
    post:
      tags:
      - Analysis
      summary: Default query
      description: 'When provided with the text parameter this call handles text input and runs the Sparv analysis.


        ### Example


        ```.bash

        curl -X POST --data-binary text="En exempelmening till nättjänsten" https://ws.spraakbanken.gu.se/ws/sparv/v3/

        ```'
      parameters:
      - name: text
        in: query
        required: true
        description: The text to be analysed
        schema:
          type: string
      - $ref: '#/components/parameters/ModeParam'
      - $ref: '#/components/parameters/IncrementalParam'
      - $ref: '#/components/parameters/LanguageParam'
      - $ref: '#/components/parameters/SettingsParam'
      responses:
        '200':
          description: Text analysis in XML
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisSchema'
        '500':
          description: Failed to run analysis
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
      operationId: postRoot
      x-operation-id-source: derived
  /schema:
    get:
      tags:
      - Analysis
      summary: Schema
      description: 'Returns the json schema generated from the provided parameters.


        ### Example


        `/schema?language=sv&mode=plain`'
      parameters:
      - $ref: '#/components/parameters/ModeParam'
      - $ref: '#/components/parameters/LanguageParam'
      - $ref: '#/components/parameters/MinifyParam'
      responses:
        '200':
          description: OK (schema returned)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsSchema'
        '500':
          description: Failed to return schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
      operationId: getSchema
      x-operation-id-source: derived
  /makefile:
    get:
      tags:
      - Analysis
      summary: Makefile
      description: 'Returns the Makefile generated from the provided parameters.


        ### Example


        [`/makefile?settings={"positional_attributes":{"dependency_attributes":["ref","dephead","deprel"],"lexical_attributes":[],"compound_attributes":[]}}`](https://ws.spraakbanken.gu.se/ws/sparv/v3/makefile?settings={"positional_attributes":{"dependency_attributes":["ref","dephead","deprel"],"lexical_attributes":[],"compound_attributes":[]}})'
      parameters:
      - $ref: '#/components/parameters/ModeParam'
      - $ref: '#/components/parameters/IncrementalParam'
      - $ref: '#/components/parameters/LanguageParam'
      - $ref: '#/components/parameters/SettingsParam'
      responses:
        '200':
          description: OK (Makefile returned)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MakefileSchema'
        '500':
          description: Failed to return Makefile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
      operationId: getMakefile
      x-operation-id-source: derived
  /join:
    get:
      tags:
      - Analysis
      summary: Join
      description: 'Joins an existing build.


        In the response of a text analysis you can find a hash number. This hash can be used to join an earlier build.


        The response contains the chosen settings, the original text and the result of the annotation.'
      parameters:
      - $ref: '#/components/parameters/IncrementalParam'
      - $ref: '#/components/parameters/HashParam'
      responses:
        '200':
          description: The settings, original input text and text analysis in XML
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JoinSchema'
        '500':
          description: Failed to join build
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
      operationId: getJoin
      x-operation-id-source: derived
components:
  schemas:
    MakefileSchema:
      type: object
      properties:
        makefile:
          type: string
          example: 'include $(SPARV_MAKEFILES)/Makefile.config

            corpus = untitled

            original_dir = original


            vrt_columns_annotations = word pos msd baseform lemgram sense complemgram compwf sentiment sentimentclass ref dephead.ref deprel

            vrt_columns             = word pos msd lemma    lex     sense complemgram compwf sentiment sentimentclass ref dephead     deprel


            vrt_structs_annotations = sentence.id paragraph.n text text.lix text.ovix text.nk

            vrt_structs             = sentence:id paragraph   text text:lix text:ovix text:nk


            xml_elements    = text

            xml_annotations = text


            token_chunk = sentence

            token_segmenter = better_word


            sentence_chunk = paragraph

            sentence_segmenter = punkt_sentence


            paragraph_chunk = text

            paragraph_segmenter = blanklines


            include $(SPARV_MAKEFILES)/Makefile.rules

            '
    GeneralError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Some error message
    JoinSchema:
      type: object
      properties:
        settings:
          $ref: '#/components/schemas/SettingsSchema'
        original:
          type: string
          example: '<text>En exempelmening till nättjänsten</text>'
        analysis:
          $ref: '#/components/schemas/AnalysisSchema'
    SettingsSchema:
      type: object
      example:
        corpus: exempelkorpus
        lang: sv
        textmode: plain
        word_segmenter: default_tokenizer
        sentence_segmentation:
          sentence_chunk: paragraph
          sentence_segmenter: default_tokenizer
        paragraph_segmentation:
          paragraph_segmenter: blanklines
        positional_attributes:
          lexical_attributes:
          - pos
          - msd
          - lemma
          - lex
          - sense
          compound_attributes:
          - complemgram
          - compwf
          dependency_attributes:
          - ref
          - dephead
          - deprel
          sentiment:
          - sentiment
        named_entity_recognition: []
        text_attributes:
          readability_metrics:
          - lix
          - ovix
          - nk
    AnalysisSchema:
      type: object
      properties:
        build:
          type: object
          properties:
            hash:
              type: string
              example: ece7233cc6fface3adeef4bfc5dc1e9fdfd94488
        result:
          type: object
          properties:
            link:
              type: string
              example: https://ws.spraakbanken.gu.se/ws/sparv/v3/download?hash=ece7233cc6fface3adeef4bfc5dc1e9fdfd94488
            analysis:
              type: string
              example: "<corpus>\n  <text lix=\"54.00\" ovix=\"inf\" nk=\"inf\">\n    <paragraph>\n        <sentence id=\"8f7-84d\">\n            <w pos=\"DT\" msd=\"DT.UTR.SIN.IND\" lemma=\"|en|\" lex=\"|en..al.1|\" sense=\"|den..1:-1.000|en..2:-1.000|\" complemgram=\"|\" compwf=\"|\" sentiment=\"\" sentimentclass=\"\" ref=\"1\" dephead=\"2\" deprel=\"DT\">En</w>\n            <w pos=\"NN\" msd=\"NN.UTR.SIN.IND.NOM\" lemma=\"|exempelmening|\" lex=\"|\" sense=\"|\" complemgram=\"|exempel..nn.1+mening..nn.1:1.090e-08|\" compwf=\"|exempel+mening|\" sentiment=\"\" sentimentclass=\"\" ref=\"2\" dephead=\"\" deprel=\"ROOT\">exempelmening</w>\n            <w pos=\"PP\" msd=\"PP\" lemma=\"|till|\" lex=\"|till..pp.1|\" sense=\"|till..1:-1.000|\" complemgram=\"|\" compwf=\"|\" sentiment=\"\" sentimentclass=\"\" ref=\"3\" dephead=\"2\" deprel=\"ET\">till</w>\n            <w pos=\"NN\" msd=\"NN.UTR.SIN.DEF.NOM\" lemma=\"|nättjänst|nättjänsten|\" lex=\"|\" sense=\"|\" complemgram=\"|nät..nn.1+tjänst..nn.2:5.711e-11|nät..nn.1+tjänst..nn.1:5.711e-11|nätt..av.1+tjänst..nn.1:1.004e-12|nätt..av.1+tjänst..nn.2:1.004e-12|nät..nn.1+tjäna..vb.1+sten..nn.2:2.049e-27|nät..nn.1+tjäna..vb.1+sten..nn.1:2.049e-27|nätt..av.1+tjäna..vb.1+sten..nn.2:4.784e-28|nätt..av.1+tjäna..vb.1+sten..nn.1:4.784e-28|\" compwf=\"|nät+tjänsten|nätt+tjänsten|nät+tjän+sten|nätt+tjän+sten|\" sentiment=\"\" sentimentclass=\"\" ref=\"4\" dephead=\"3\" deprel=\"PA\">nättjänsten</w>\n        </sentence>\n    </paragraph>\n  </text>\n</corpus>\n"
  parameters:
    HashParam:
      name: hash
      in: query
      required: true
      description: Hash of the analysis
      schema:
        type: string
    MinifyParam:
      name: minify
      in: query
      required: false
      description: If set to true, some attributes needed for the frontend will be excluded from the response.
      schema:
        type: boolean
        default: false
    LanguageParam:
      name: language
      in: query
      required: false
      description: 'The language of the text to be analysed.

        Check [this language table](https://spraakbanken.gu.se/eng/research/infrastructure/sparv/distribution/pipeline#language_table) for more information.

        '
      schema:
        type: string
        default: sv
        enum:
        - it
        - de
        - sv-1800
        - bg
        - ca
        - ru
        - nl
        - pl
        - fr
        - es
        - sv-dev
        - ro
        - la
        - sk
        - pt
        - sl
        - et
        - fi
        - gl
        - en
        - sv
        - 'no'
    SettingsParam:
      name: settings
      in: query
      required: false
      description: The settings to be used for the analysis. Must satisfy a shema retrieved from [Schema](#tag/Analysis/paths/~1schema/get).
      schema:
        $ref: '#/components/schemas/SettingsSchema'
    ModeParam:
      name: mode
      in: query
      required: false
      description: The input mode
      schema:
        type: string
        default: plain
        enum:
        - plain
        - xml
        - file
    IncrementalParam:
      name: incremental
      in: query
      required: false
      description: 'Set to `true` if you want to receive more information on how the analysis is being processed.

        Note: Incremental information can only be displayed if your query is run for the first time.

        The progress information is not available for older builds.

        '
      schema:
        type: boolean
        default: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: secret_key