You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ge c0d4ad668b upd 1 month ago
Pipfile init 1 month ago
Pipfile.lock init 1 month ago upd 1 month ago
cursed-archivebox-api.service upd 1 month ago upd 1 month ago
requirements.txt init 1 month ago

Cursed API for ArchiveBox

ArchiveBox doesn't have a web API yet. This is shitty single-endpoint API to automate page archiving. It uses subprocess to run archivebox CLI. archivebox CLI runs in new thread to avoid blocking main thread.


You must deploy API to server which ArchieveBox runs.

Make working directory, create virtualenv and install dependencies:

apt install -y git python3-venv
mkdir -p /opt/cursed_archievebox_api && cd /opt/cursed_archievebox_api
python -m venv env
source env/bin/activate
pip install bottle gunicorn
git clone .

Start API. Set actual path to docker-compose.yml:

ARCHIVEBOX_BIN="docker compose -f /opt/archievebox/docker-compose.yml run archivebox" python

See also cursed-archivebox-api.service.

Install service:

cp cursed-archivebox-api.service /etc/systemd/system
systemctl enable --now cursed-archivebox-api.service

See logs:

journalctl -u cursed-archivebox-api.service -f


Variable Default
ARCHIVEBOX_BIN /usr/bin/archivebox (default for non-Docker installations)
CURSED_SERVER gunicorn See server backends

GET /add

Query parameters:

  • url. Resource URL
  • depth. Archive depth. Default: 0 (current page)
  • tag. List of comma separated tags e.g. my_tag, my_tag,another_one.

Example request:

curl -i 'http://localhost:9998/add?url=,example'