Difference between revisions of "Using the Open Opus API"

From Open Opus
Jump to navigation Jump to search
Line 147: Line 147:
 
Options are:
 
Options are:
  
. Medieval
+
* Medieval
. Renaissance
+
* Renaissance
. Baroque
+
* Baroque
. Classical
+
* Classical
. Early Romantic
+
* Early Romantic
. Romantic
+
* Romantic
. Late Romantic
+
* Late Romantic
. 20th Century
+
* 20th Century
. Post-War
+
* Post-War
. 21st Century
+
* 21st Century
  
 
Response:
 
Response:

Revision as of 00:18, 5 November 2019

The Open Opus API is a very straightforward RESTful web service which returns data in JSON format. It's completely free to use and it requires no registration at all. You can use it in any website, HTTPS or not - but we strongly suggest you to serve your web app over HTTPS. You also can use the Open Opus API in any non-web application.

Base URI

All endpoints begin with

https://api.openopus.org

Endpoints

The Open Opus API has four main endpoint groups: composers, genres, works and performers.

Composers

List popular composers

/composer/list/pop.json

Response:

{
    "status": {
        "version": "1.19.10",
        "success": "true",
        "source": "db",
        "rows": 23,
        "processingtime": 0.0017228126525878906,
        "api": "Open Opus-dyn"
    },
    "request": {
        "type": "pop",
        "item": "1"
    },
    "composers": [
        {
            "id": "87",
            "name": "Bach",
            "complete_name": "Johann Sebastian Bach",
            "birth": "1685-01-01",
            "death": "1750-01-01",
            "epoch": "Baroque",
            "portrait": "https://assets.openopus.org/portraits/12091447-1568084857.jpg"
        },
        {
            "id": "145",
            "name": "Beethoven",
            "complete_name": "Ludwig van Beethoven",
            "birth": "1770-01-01",
            "death": "1827-01-01",
            "epoch": "Early Romantic",
            "portrait": "https://assets.openopus.org/portraits/55910756-1568084860.jpg"
        }
    ]
}

List essential composers

/composer/list/rec.json

Response:

{
    "status": {
        "version": "1.19.10",
        "success": "true",
        "source": "db",
        "rows": 77,
        "processingtime": 0.0025510787963867188,
        "api": "Open Opus-dyn"
    },
    "request": {
        "type": "rec",
        "item": "1"
    },
    "composers": [
        {
            "id": "149",
            "name": "Adams",
            "complete_name": "John Adams",
            "birth": "1947-01-01",
            "death": null,
            "epoch": "21st Century",
            "portrait": "https://assets.openopus.org/portraits/74462091-1568084854.jpg"
        },
        {
            "id": "87",
            "name": "Bach",
            "complete_name": "Johann Sebastian Bach",
            "birth": "1685-01-01",
            "death": "1750-01-01",
            "epoch": "Baroque",
            "portrait": "https://assets.openopus.org/portraits/12091447-1568084857.jpg"
        }
    ]
}

List composers by first letter

/composer/list/name/a.json

Response:

{
    "status": {
        "version": "1.19.10",
        "success": "true",
        "source": "db",
        "rows": 6,
        "processingtime": 0.0013890266418457031,
        "api": "Open Opus-dyn"
    },
    "request": {
        "type": "name",
        "item": "a"
    },
    "composers": [
        {
            "id": "149",
            "name": "Adams",
            "complete_name": "John Adams",
            "birth": "1947-01-01",
            "death": null,
            "epoch": "21st Century",
            "portrait": "https://assets.openopus.org/portraits/74462091-1568084854.jpg"
        },
        {
            "id": "130",
            "name": "Adès",
            "complete_name": "Thomas Adès",
            "birth": "1971-01-01",
            "death": null,
            "epoch": "21st Century",
            "portrait": "https://assets.openopus.org/portraits/31194505-1568084855.jpg"
        }
    ]
}

List composers by period

/composer/list/epoch/Early Romantic.json

Options are:

  • Medieval
  • Renaissance
  • Baroque
  • Classical
  • Early Romantic
  • Romantic
  • Late Romantic
  • 20th Century
  • Post-War
  • 21st Century

Response:

{
    "status": {
        "version": "1.19.10",
        "success": "true",
        "source": "db",
        "rows": 13,
        "processingtime": 0.0015330314636230469,
        "api": "Open Opus-dyn"
    },
    "request": {
        "type": "epoch",
        "item": "Early Romantic"
    },
    "composers": [
        {
            "id": "145",
            "name": "Beethoven",
            "complete_name": "Ludwig van Beethoven",
            "birth": "1770-01-01",
            "death": "1827-01-01",
            "epoch": "Early Romantic",
            "portrait": "https://assets.openopus.org/portraits/55910756-1568084860.jpg"
        },
        {
            "id": "51",
            "name": "Bellini",
            "complete_name": "Vincenzo Bellini",
            "birth": "1801-01-01",
            "death": "1835-01-01",
            "epoch": "Early Romantic",
            "portrait": "https://assets.openopus.org/portraits/47933748-1568084861.jpg"
        }
    ]
}