Public documentation

Content:

 

Access to APIs

To start using the API, you first need to obtain an API key by sending a request to tord.nilsen@nasjonalmuseet.no or dag.hensten@nasjonalmuseet.no.

Unique identifiers

The JSON document for an object contains two identifers: NmId and _id.

NmId is the identifier used by our managementsystem. This value can contain ampersand(&) and is not suitable in urls

_id is MongoDB’s primary key and is NmId where ampersand (&) is replaced with underscore (_) and is used as parameter.

All fields and parameters are camelCased

Base URL

Base URL is https://api.nasjonalmuseet.no/v1/

Please notice version-no. Currently on v1

 

Collection API

GET /v1/collection/object?_id=[Object Number]&lang=[Language]&api_key=[key] 

gives access to a simplified information about an object.

Parameter Format Notes
_id a-z/0-9 Object number assigned to the object
lang no or en Language parameter
api_key a-z/0-9 Your API-key, mandatory for every request


Example request Collection API:

https://api.nasjonalmuseet.no/v1/collection/object?lang=no&_id=NG.M.00939&api_key=[key]

 Example response Collection API:


{
  "data": [
    {
      "_id": "NG.M.00939",
      "nmId": "NG.M.00939",
      "objectName": "['Maleri']",
      "technique": [
        "Tempera",
        "Fettstift"
      ],
      "materials": [
        "Papplate"
      ],

Collection Details API

 

GET /collection/object/details/?_id=[Object Number]&lang=[Language]&api_key=[key] 

gives access to detailed information about an object.

Parameter Format Notes
_id a-z/0-9 Object number assigned to the object
lang no or en Language parameter
api_key a-z/0-9 Your API-key, mandatory for every request


Example request Collection API:

https://api.nasjonalmuseet.no/v1/collection/object/details/?lang=no&_id=NG.M.00939&api_key=[key]


Example response Collection Details API



{
  "data": [
    {
      "_id": "NG.M.00939",
      "MetaData": {
        "OrgUnit": [
          "Billedkunstsamlingene"
        ],
        "AccessionTypeNMK": [
          "Ervervelse"
        ],
        "Owner": [
          {
            "FullName": "Nasjonalmuseet for kunst, arkitektur og design",
            "PersonType": [
              "Institusjon"
            ],
            "Id": "47704",
            "LastName": [
              "Nasjonalmuseet for kunst, arkitektur og design"
            ],
            "UrlSegment": "nasjonalmuseet-for-kunst-arkitektur-og-design"
          }
        ],
        "BarcodeNumber": [
          "G-34275"
        ],
        "Keywords": [
          "Bildende kunst"
        ],
        "Materials": [
          "Papplate"
        ],
        "IsArtwork": [
          true
        ],
        "CataloguingLevel": [
          "Enkeltobjekt"
        ],
        "ObjectTitle": [
          {
            "Type": "",
            "Title": "Skrik",
            "Alternatives": [
              {
                "Title": "The Scream",
                "Lang": "ENG"
              }
            ]
          }
        ],
        "ObjectType": [
          "Billedkunst"
        ],
        "SubjectType": [
          "Landskap",
          "Portrett"
        ],

 

Advanced query

collection/query

Uses MongoDB query syntax for a more advanced search. 
Parameters can be used to query, filter and control the results returned by the API. They can be passed as JSON in the body of the request.
See Mongodb manual for query syntax

 

GET /collection/query/?api_key[key]

Example request Collection Query API


http request example:

GET /collection/query/?api_key[key] HTTP/1.1
Host: api.nasjonalmuseet.no
Content-Type: text/plain
Content-Length: 49

{"copyrightStatus" : "Inaktive", "title":"Skrik"}

Python request example:

import requests

url = "https://api.nasjonalmuseet.no/v1/collection/query/?api_key=[key]"

payload="{\"MetaData.Copyrights.CopyrightsStatus\" : \"inactive\", \"title\":\"Skrik\"}"
headers = {
  'Content-Type': 'text/plain'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)


Images

Images is stored in folders

/media/tif/

/media/jpeg/

/media/thumbs/

You will find filename in [Multimedia][OriginalFile]