Skip to content

Upstream quirks

This page lists the behavior of the BASE HTTP interface that shapes bibliofabric.base. The sources are the BASE developer page and the BASE Interface Guide (the PDF the page links as "BASE Interface Guide", version 1.27). The whole client is built from these documents: the interface answers only whitelisted IPs and apikey holders, so none of the shapes below were observed against the live API. Where the guide leaves room for doubt, the quirk says so.

Access and pace

  • The interface answers only requests from a whitelisted IP or IP range, or requests that carry an apikey parameter. Without either it answers with Access denied for IP address xxx.xxx.xxx.xxx and user agent xyz..
  • The pace limit is one request per second (1 QPS), and it is the pace the client defaults to. Raise it only if your registration says you may.
  • The apikey travels as a query parameter, so it appears in URLs. The client redacts it from error messages and logs.
  • hits defaults to 10 and accepts at most 125 records per answer.
  • offset defaults to 0 and accepts at most 999. Combined with the page size ceiling, one query reaches roughly the first 1000 records of a result set; the client raises ConfigurationError for an offset past 999 instead of sending a request the interface rejects. For complete lists, narrow the query or scope it to a collection.
  • query takes SOLR syntax and at most 1000 characters. Unquoted terms combine with AND, OR, NOT, phrases, wildcards (*, ?), and ranges (dcyear:[1983 TO 2009]) are documented in the guide's query syntax section.
  • sortby names one field and one direction: dcyear desc. The sortable fields are dchdate, dccreator, dctitle, dcoa, and dcyear. Without sortby the interface sorts by relevance.
  • hits=0 is a valid page size; the answer then carries the total and, if requested, facets, but no records. count() uses it.
  • Facet refinement (f_<field>) searches for the exact term of a facet field, while the same term inside query also matches records where the term appears as one keyword of the field's contents. The guide gives query=unix+dcsubject:education versus f_dcsubject=education as the example.
  • The guide lists No results found! among the error messages, and does not say whether an empty result arrives as an error body or as a normal answer with numFound="0". The client treats a numFound="0" answer as an empty page.

Errors

  • Error answers are XML: <error>Collection 'xyz' not found!</error>, in the 400 and 500 status ranges. The client maps the status to APIError, AuthError, or NotFoundError and quotes the body.
  • A non-XML body (the access-denied text is one) raises APIError with the first characters of the body in the message. A 401 or 403 status raises AuthError before the body is parsed.

Repositories

  • ListRepositories answers one unpaged XML list. The optional coll parameter takes a pre-defined collection name: a continent (ceu), a country (de), or a state (denw); a name the interface does not know answers Collection 'xyz' not found!.
  • ListProfile needs the target internal name a ListRepositories entry carries.

Formats

  • The default answer format is XML; the client reads it and sends no format parameter. The interface also offers format=json, but the guide publishes no JSON example, so the client does not use it. Passing params={"format": "json"} would change the wire format the client cannot parse, so don't.
  • Field values arrive with the types of the underlying index: dcyear and dcoa as integers, dchdate as an ISO timestamp, everything else as strings, and multi-valued fields as lists.
  • The guide documents no rate-limit headers and no per-response quota fields beyond the responseHeader request echo.