Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

JSON API

Read-only JSON endpoints that expose DaSCH research project metadata. They serve the same project data as the DPE pages and the OAI-PMH endpoint, sourced from the in-process project cache that is loaded from the data directory at startup. The handlers live in the dpe-server crate (server/src/fragments.rs).

Endpoints

MethodPathReturns
GET/dpe/api/v2/projectsJSON array of all projects
GET/dpe/api/v2/projects/{shortcode}A single project object
  • Method: GET only.
  • Response: Content-Type: application/json.
  • Authentication: none.
EnvironmentBase URL
Local development (just watch-dpe)http://localhost:4000
DEVhttps://api.dev.dasch.swiss
ProductionNot yet deployed

List all projects

curl "https://api.dev.dasch.swiss/dpe/api/v2/projects"

Returns a JSON array containing every project. The list is not paginated and not filtered — the entire collection is returned in one response. (The HTML listing at /dpe/projects supports search and faceting; this JSON endpoint does not.)

Fetch a single project

The path segment is the project shortcode, not the id field. Matching is case-insensitive, so 0803 and any case variant of an alphanumeric shortcode (e.g. 080c for 080C) resolve to the same project.

curl "https://api.dev.dasch.swiss/dpe/api/v2/projects/0803"
StatusReturned when
200 OKThe shortcode resolves to a project.
400 Bad RequestThe shortcode is not alphanumeric (e.g. contains /, -, _, or other characters). Empty body.
404 Not FoundThe shortcode is well-formed but matches no project. Empty body.

Response format

Both endpoints serialize the project metadata with camelCase keys. The shape mirrors the stored project JSON files; the single-project endpoint returns one object, the list endpoint an array of the same. For the meaning and cardinality of each field, see the Metadata Model (v2); the table below describes only the wire format.

KeyTypeNotes
idstringInternal project id
pidstringPersistent identifier (ARK URL)
namestringDisplay name
shortcodestringProject shortcode (the lookup key for the single-project endpoint)
officialNamestring
statusstring"Ongoing" or "Finished" (PascalCase, unlike the rest of the payload)
shortDescriptionstring
descriptionobjectLanguage code → text
startDate, endDatestringYYYY-MM-DD
urlobject | array | nullRaw stored value — either a structured reference object or a legacy string array; not normalized
secondaryUrlobject | nullSecondary reference (new-format files only)
howToCitestring
accessRightsobjectAccess-rights type and optional embargo date
legalInfoarrayLicense, copyright holder, and authorship entries
dataManagementPlanstring | null
dataPublicationYearstring | null
typeOfDataarray<string> | null
dataLanguagearray<string> | null
clustersarray<string> | nullCluster ids
collectionsarray<string> | nullCollection ids
recordsarray<string> | nullRecord ids
keywordsarray<object>Language maps
disciplinesarray
temporalCoveragearray
spatialCoveragearrayAuthority-file references
attributionsarray
abstractobject | nullLanguage map (the field is named abstract, not abstractText)
contactPointarray<string> | null
publicationsarray | null
fundingobject
alternativeNamesarray<object> | null
documentationMaterialarray<string> | null
provenancestring | null
additionalMaterialarray<string> | null

Notes and limitations

  • Read-only. GET only; there are no create/update/delete operations.
  • No pagination or filtering on the list endpoint — it always returns the full collection.
  • Cached at startup. Data is read from the configured data directory when the server starts; changes to project files require a restart to surface.
  • url is a raw passthrough. Unlike the typed project model used to render pages, the JSON output emits the stored url value verbatim (structured object or legacy array), including any placeholder values.