An API to get MARC (Machine-Readable Cataloging) data in many formats (MARC ISO, MARCXML, mnemonic MARC, JSON) from ILS like Pergamum.
If you use an instance of Pergamum version 10 or you want to use a JavaScript tool that uses API, see the Get Pergamum Marc Records tool.
Using Docker
docker pull vitorsilverio/libraryapi:main
docker run -d --name libraryapi -p 8000:80 vitorsilverio/libraryapi:main
- Make sure you have Python 3.12+ installed. You may have to prefix
pip
anduvicorn
commands withpython3.12 -m
if you have more than one Python interpreter. - Install Pipenv with pip:
pip install --user pipenv
- In Ubuntu 22.04:
export SETUPTOOLS_USE_DISTUTILS=stdlib
pipenv install --deploy
pipenv shell
uvicorn app.main:app --port 80
append--reload
if you are developing and change the port
Check the endpoints in documentation page at http://deploy-ip:port/docs
See a working demo instance:
Using query params:
- A MARC ISO 2709 record from Pergamum:
- A MARCXML record from Pergamum:
- A mnemonic MARC record (MARCMaker/MarcEdit format) from Pergamum:
- A JSON MARC record from Pergamum (default, if no "media_type" is specified or if it is "application/json"):
Using headers:
- A MARC ISO 2709 record from Pergamum:
curl "https://libraryapi.sites.ufsc.br/api/v2/pergamum/64967" \
-H "Server: https://pergamumweb.udesc.br/pergamum/web_service/servidor_ws.php" \
-H "Accept: application/marc"
- A MARCXML record from Pergamum:
curl "https://libraryapi.sites.ufsc.br/api/v2/pergamum/64967" \
-H "Server: https://pergamumweb.udesc.br/pergamum/web_service/servidor_ws.php" \
-H "Accept: application/xml"
- A mnemonic MARC record (MARCMaker/MarcEdit format) from Pergamum:
curl "https://libraryapi.sites.ufsc.br/api/v2/pergamum/64967" \
-H "Server: https://pergamumweb.udesc.br/pergamum/web_service/servidor_ws.php" \
-H "Accept: text/plain"
- A JSON MARC record from Pergamum (default, if no "media_type" is specified or if it is "application/json"):
curl "https://libraryapi.sites.ufsc.br/api/v2/pergamum/64967" \
-H "Server: https://pergamumweb.udesc.br/pergamum/web_service/servidor_ws.php" \
-H "Accept: application/json"
- A MARC ISO 2709 record from Pergamum: https://libraryapi.sites.ufsc.br/pergamum/mrc?url=https://pergamumweb.udesc.br/pergamum&id=64967
- A MARCXML record from Pergamum: https://libraryapi.sites.ufsc.br/pergamum/xml?url=https://pergamumweb.udesc.br/pergamum&id=64967
- A mnemonic MARC record (MARCMaker/MarcEdit format) from Pergamum: https://libraryapi.sites.ufsc.br/pergamum/mrk?url=https://pergamumweb.udesc.br/pergamum&id=64967
Please read Contibution.md to know how to contribute code or buy me a ☕