University of Gothenburg Searching API

Searching is the main way to get data from Karp. If a query string is given, an actual search will be done, otherwise all entries in the resource will be returned. - Use [`/query`](#tag/Searching/operation/query_query__resources__get) to be given all the matching entries - Use [`/query/stats`](#tag/Searching/operation/query_stats_query_stats__resources__get) to only be given the count of matches in each given resource ### Query language #### Search strings In the examples below, `` can be either: - any characters except `"`, `|`, `(` or `)` - any characters, enclosed in double quotes, but any `"` inside the quotes must be escaped with `\`, for example: `equals|field|"A "good" example"` In addition to these rules, characters that are part of the URI syntax, such as `?` and `&` needs to be encoded. For example, the whole query can be encoded using Javascript's `encodeURIComponent`. #### Query operators - `contains||` Find all entries where the field contains . More premissive than equals. - `endswith||` Find all entries where the field ends with - `equals||` Find all entries where equals . Stricter than contains - `exists|` Find all entries that has the field . - `freetext|` Search in all fields for and similar values. - `gt||` Find all entries where is greater than . - `gte||` Find all entries where is greater than or equals . - `lt||` Find all entries where is less than . - `lte||` Find all entries where is less than or equals . - `missing|` Search for all entries that doesn't have the field . - `regexp||` Find all entries where the field matches the regex . - `startswith||` Find all entries where starts with . #### Logical Operators The logical operators can be used both at top-level and lower-levels. - `not(||||...)` Find all entries that doesn't match the expression . - `and(||||...)` Find all entries that matches AND . - `or(||||...)` Find all entries that matches OR . #### Sub-queries - searching in collections of objects Used for fields with setting `collection: true` and that contain other fields (collection of objects). Boolean queries such as: `and(equals|my_field.x|1||equals|my_field.y|3)` will find entries where objects in `my_field` match `equals|x|1` or `equals|y|3`, or both. To find entries where an individual object in `my_field` matches a boolean query, wrap the query with the sub-query notation: `my_field(and(equals|x|1||equals|y|3))`. - `(expression)` Do `` on objects inside ``. `` must be a collection. #### Regular expressions Always matches complete tokens. #### Examples - `not(missing|pos)` - `and(freergxp|str.*ng||regexp|pos|str.*ng)` - `and(missing|pos||equals|wf||or|blomma|äpple` - `and(equals|wf|sitta||not||equals|wf|satt`

Operations 3

GET /query/entries/{resource_id}/{entry_ids} Get Entries By Id #
GET /query/stats/{resources} Get statistics for search #
GET /query/{resources} Search #

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-searching-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-searching-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Karp Searching API
  description: 'Karp is Språkbanken''s tool for editing structural data.


    The

    main goal of Karp is to be great for working with **lexical** data, but will work with

    other data as well.


    Read more here'
  version: 7.0.0
servers:
- url: /karp/v7
tags:
- name: Searching
  description: Searching is the main way to get data from Karp.
paths:
  /query/entries/{resource_id}/{entry_ids}:
    get:
      tags:
      - Searching
      summary: Get Entries By Id
      description: Returns a list of entries matching the given ids
      operationId: Get_entries_by_id_query_entries__resource_id___entry_ids__get
      security:
      - APIKeyQuery: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: The resource to perform operation on
          title: Resource Id
        description: The resource to perform operation on
      - name: entry_ids
        in: path
        required: true
        schema:
          type: string
          pattern: ^\w(,\w)*
          description: Comma-separated. The ids to perform operation on.
          title: Entry Ids
        description: Comma-separated. The ids to perform operation on.
      - name: authorization
        in: header
        required: false
        schema:
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntriesByIdResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-openapi-router-order: 3
  /query/stats/{resources}:
    get:
      tags:
      - Searching
      summary: Get statistics for search
      description: Same as `/query`, but without returning the hits.
      operationId: query_stats_query_stats__resources__get
      security:
      - APIKeyQuery: []
      parameters:
      - name: resources
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-z_0-9\-]+(,[a-z_0-9\-]+)*$
          description: A comma-separated list of resource identifiers
          title: Resources
        description: A comma-separated list of resource identifiers
      - name: q
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: query
          description: "The query. If missing, the number of entries in the chosen resource(s) \n            will be returned. See [Query DSL](#section/Query-DSL)"
        description: "The query. If missing, the number of entries in the chosen resource(s) \n            will be returned. See [Query DSL](#section/Query-DSL)"
      - name: authorization
        in: header
        required: false
        schema:
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryStatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-openapi-router-order: 2
  /query/{resources}:
    get:
      tags:
      - Searching
      summary: Search
      description: Returns a list of entries matching the given query in the given resources. The results are mixed from the given resources.
      operationId: query_query__resources__get
      security:
      - APIKeyQuery: []
      parameters:
      - name: resources
        in: path
        required: true
        schema:
          type: string
          pattern: ^[a-z_0-9\-]+(,[a-z_0-9\-]+)*$
          description: A comma-separated list of resource identifiers
          title: Resources
        description: A comma-separated list of resource identifiers
      - name: q
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: query
          description: The query. If missing, all entries in chosen resource(s) will be returned. See [Searching](#section/Searching)
        description: The query. If missing, all entries in chosen resource(s) will be returned. See [Searching](#section/Searching)
      - name: from
        in: query
        required: false
        schema:
          type: integer
          description: Specify which entry should be the first returned.
          default: 0
          title: From
        description: Specify which entry should be the first returned.
      - name: size
        in: query
        required: false
        schema:
          type: integer
          description: Number of entries in page.
          default: 25
          title: Size
        description: Number of entries in page.
      - name: sort
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The `field` to sort by. If missing, default order for each resource will be used.
          title: Sort
        description: The `field` to sort by. If missing, default order for each resource will be used.
      - name: lexicon_stats
        in: query
        required: false
        schema:
          type: boolean
          description: Show the hit count per lexicon
          default: true
          title: Lexicon Stats
        description: Show the hit count per lexicon
      - name: path
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: "A dot-separataed path to for returning a specific field in JSON. \n        Only supports one path down into the tree with no indexing.\n        For example, to fetch only the field `baseform` in the entry, use: `?path=entry.baseform`\n        If the selected field is an array, the result will also be wrapped in an array."
          title: Path
        description: "A dot-separataed path to for returning a specific field in JSON. \n        Only supports one path down into the tree with no indexing.\n        For example, to fetch only the field `baseform` in the entry, use: `?path=entry.baseform`\n        If the selected field is an array, the result will also be wrapped in an array."
      - name: highlight
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/HighlightParam'
          description: "Adds which fields the query matched and a small hit context with `<em>` wrapped around the match.\n                        For compatibility reasons the values are true/new/false. true gives an older version of the highlight and\n                        new gives the future format, which includes indices for lists."
          default: 'false'
        description: "Adds which fields the query matched and a small hit context with `<em>` wrapped around the match.\n                        For compatibility reasons the values are true/new/false. true gives an older version of the highlight and\n                        new gives the future format, which includes indices for lists."
      - name: authorization
        in: header
        required: false
        schema:
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-openapi-router-order: 1
components:
  schemas:
    EntryDto:
      properties:
        id:
          type: string
          title: Id
          examples:
          - 01BJQMF54D093DXEAWZ6JYRPAQ
        version:
          type: integer
          title: Version
        lastModified:
          type: number
          title: Lastmodified
        lastModifiedBy:
          type: string
          title: Lastmodifiedby
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
        discarded:
          type: boolean
          title: Discarded
        resource:
          type: string
          title: Resource
        entry:
          additionalProperties: true
          type: object
          title: Entry
      type: object
      required:
      - id
      - version
      - lastModified
      - lastModifiedBy
      - discarded
      - resource
      - entry
      title: EntryDto
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HighlightParam:
      type: string
      enum:
      - 'true'
      - 'false'
      - new
      title: HighlightParam
    QueryStatsResponse:
      properties:
        total:
          type: integer
          title: Total
        distribution:
          additionalProperties:
            type: integer
          type: object
          title: Distribution
      type: object
      required:
      - total
      - distribution
      title: QueryStatsResponse
    EntriesByIdResponse:
      properties:
        total:
          type: integer
          title: Total
        hits:
          items:
            anyOf:
            - $ref: '#/components/schemas/EntryDto'
            - {}
          type: array
          title: Hits
      type: object
      required:
      - total
      - hits
      title: EntriesByIdResponse
    QueryResponse:
      properties:
        total:
          type: integer
          title: Total
        hits:
          items:
            anyOf:
            - $ref: '#/components/schemas/EntryDto'
            - {}
          type: array
          title: Hits
        distribution:
          anyOf:
          - additionalProperties:
              type: integer
            type: object
          - type: 'null'
          title: Distribution
      type: object
      required:
      - total
      - hits
      - distribution
      title: QueryResponse
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    HTTPBearer:
      type: http
      scheme: bearer