# University of Gothenburg Searching API

**Canonical:** https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-searching-api/  
**Provider:** University of Gothenburg — https://apis.io/providers/university-of-gothenburg/  
**Base URL:** https://ws.spraakbanken.gu.se/ws/korp/v8  
**Documentation:** https://ws.spraakbanken.gu.se/docs/korp

University of Gothenburg Searching API is one of 33 APIs that [University of Gothenburg](https://apis.io/providers/university-of-gothenburg/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. This API exposes 2 JSON Schema definitions. Tagged areas include Searching. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, authentication docs, and 2 JSON Schemas.

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, `<string>` 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|<field>|<string>` Find all entries where the field <field> contains <string>. More premissive than equals. - `endswith|<field>|<string>` Find all entries where the field <field> ends with <string> - `equals|<field>|<string>` Find all entries where <field> equals <string>. Stricter than contains - `exists|<field>` Find all entries that has the field <field>. - `freetext|<string>` Search in all fields for <string> and similar values. - `gt|<field>|<value>` Find all entries where <field> is greater than <value>. - `gte|<field>|<value>` Find all entries where <field> is greater than or equals <value>. - `lt|<field>|<value>` Find all entries where <field> is less than <value>. - `lte|<field>|<value>` Find all entries where <field> is less than or equals <value>. - `missing|<field>` Search for all entries that doesn't have the field <field>. - `regexp|<field>|<regex.*>` Find all entries where the field <field> matches the regex <regex.*>. - `startswith|<field>|<string>` Find all entries where <field>starts with <string>. #### Logical Operators The logical operators can be used both at top-level and lower-levels. - `not(<expression1>||<expression2>||...)` Find all entries that doesn't match the expression <expression>. - `and(<expression1>||<expression2>||...)` Find all entries that matches <expression1> AND <expression2>. - `or(<expression1>||<expression2>||...)` Find all entries that matches <expression1> OR <expression2>. #### 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))`. - `<field>(expression)` Do `<expression>` on objects inside `<field>`. `<field>` 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)

| Method | Path | Summary |
|---|---|---|
| GET | `/query/entries/{resource_id}/{entry_ids}` | Get Entries By Id |
| GET | `/query/stats/{resources}` | Get statistics for search |
| GET | `/query/{resources}` | Search |

## Machine-readable artifacts (17)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/openapi/university-of-gothenburg-searching-api-openapi.yml
- **Documentation** — https://ws.spraakbanken.gu.se/docs/korp
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-korp-info-example.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/json-schema/university-of-gothenburg-korp-info.json
- **Documentation** — https://ws.spraakbanken.gu.se/docs/metadata
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-metadata-list-ids-example.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/json-schema/university-of-gothenburg-sbx-resource.json
- **Documentation** — https://ws.spraakbanken.gu.se/docs/mink
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-mink-info-example.json
- **Authentication** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/authentication/university-of-gothenburg-authentication.yml
- **Documentation** — https://ws.spraakbanken.gu.se/docs/sparv
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-sparv-ping-example.json
- **Documentation** — https://ws.spraakbanken.gu.se/docs/karp
- **Documentation** — https://ws.spraakbanken.gu.se/docs/karp-s
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-karp-search-config-example.json
- **Examples** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/examples/university-of-gothenburg-gupea-oai-identify-example.xml
- **Vocabulary** — https://raw.githubusercontent.com/api-evangelist/university-of-gothenburg/refs/heads/main/vocabulary/university-of-gothenburg-oai-metadata-formats-vocabulary.yml

## Other University of Gothenburg APIs (12)

- [GUPEA DSpace 8 REST API](https://apis.io/apis/university-of-gothenburg/gupea-dspace-rest/)
- [Shibboleth Identity Provider — SAML 2.0 Metadata](https://apis.io/apis/university-of-gothenburg/shibboleth-idp/)
- [Microsoft AD FS Identity Provider (SWAMID entity)](https://apis.io/apis/university-of-gothenburg/adfs-idp/)
- [DataCite DOI Registration (client SND.SPRKB, via the Swedish National Data Service)](https://apis.io/apis/university-of-gothenburg/datacite-registration/)
- [Crossref Membership (members 36737 and 51378)](https://apis.io/apis/university-of-gothenburg/crossref-membership/)
- [Quality of Government (QoG) Open Data](https://apis.io/apis/university-of-gothenburg/qog-data/)
- [Microsoft 365 / Entra ID Tenancy (medarbetarportalen.gu.se)](https://apis.io/apis/university-of-gothenburg/microsoft-365-tenancy/)
- [University of Gothenburg Analysis API](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-analysis-api/)
- [University of Gothenburg Cache management API](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-cache-management-api/)
- [University of Gothenburg Cleanup API](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-cleanup-api/)
- [University of Gothenburg Concordance API](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-concordance-api/)
- [University of Gothenburg Config API](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-config-api/)

## Tags

Searching

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/university-of-gothenburg/university-of-gothenburg-searching-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/university-of-gothenburg/.
