skip to navigation
skip to content

archivenow 2017.

A Python library to push web resources into public web archives

A Tool To Push Web Resources Into Web Archives

Archive Now (archivenow) currently is configured to push resources into four public web archives. You can easily add more archives by writing a new archive handler (e.g., and place it inside the folder “handlers”.

As explained below, this library can be used through:

  • Command Line Interface (CLI)
  • A Web Service
  • A Docker Container
  • Python


The latest release of archivenow can be installed using pip:

$ pip install archivenow

The latest development version containing changes not yet released can be installed from source:

$ git clone
$ cd archivenow
$ pip install -r requirements.txt
$ pip install ./


Usage of sub-commands in archivenow can be accessed through providing the -h or –help flag, like any of the below.

$ archivenow -h
usage: [-h] [--cc] [--cc_api_key [CC_API_KEY]] [--ia] [--is]
               [--wc] [-v] [--all] [--server] [--host [HOST]]
               [--port [PORT]]

positional arguments:
  URI                   URI of a web resource

optional arguments:
  -h, --help            show this help message and exit
  --cc                  Use The Archive
  --cc_api_key [CC_API_KEY]
                        An API KEY is required by The Archive
  --ia                  Use The Internet Archive
  --is                  Use The
  --wc                  Use The WebCite Archive
  -v, --version         Report the version of archivenow
  --all                 Use all possible archives
  --server              Run archiveNow as a Web Service
  --host [HOST]         A server address
  --port [PORT]         A port number to run a Web Service


Example 1

To save the web page ( in the Internet Archive:

$ archivenow --ia

Example 2

By default, the web page (e.g., will be saved in the Internet Archive if no optional arguments are provided:

$ archivenow

Example 3

To save the web page ( in the Internet Archive ( and

$ archivenow --ia --is

Example 4

To save the web page ( in all configured web archives:

$ archivenow --all --cc_api_key $Your-Perma-CC-API-Key


You can run archivenow as a web service. You can specify the server address and/or the port number (e.g., –host localhost –port 11111)

$ archivenow --server

   2017-02-09 14:20:33
   Running on
   (Press CTRL+C to quit)

Example 5

To save the web page ( in The Internet Archive through the web service:

$ curl -i

     HTTP/1.0 200 OK
     Content-Type: application/json
     Content-Length: 95
     Server: Werkzeug/0.11.15 Python/2.7.10
     Date: Thu, 09 Feb 2017 14:29:23 GMT

      "results": [

Example 6

To save the web page ( in all configured archives though the web service:

$ curl -i

    HTTP/1.0 200 OK
    Content-Type: application/json
    Content-Length: 172
    Server: Werkzeug/0.11.15 Python/2.7.10
    Date: Thu, 09 Feb 2017 14:33:47 GMT

      "results": [
        "Error (The Archive): An API KEY is required"

Example 7

Because an API Key is required by, the HTTP request should be as follows:

$ curl -i$Your-Perma-CC-API-Key

Or use

$ curl -i$Your-Perma-CC-API-Key

Running as a Docker Container

$ docker pull maturban/archivenow

Different ways to run archivenow

$ docker run -it --rm maturban/archivenow -h
$ docker run -p 80:12345 -it --rm maturban/archivenow --server
$ docker run -p 80:11111 -it --rm maturban/archivenow --server --port 11111
$ docker run -it --rm maturban/archivenow --ia

Python Usage

>>> from archivenow import archivenow

Example 8

To save the web page ( in The WebCite Archive:

>>> archivenow.push("","wc")

Example 9

To save the web page ( in all configured archives:

>>> archivenow.push("","all")
['','','','Error (The Archive): An API KEY is required]

Example 10

To save the web page ( in The

>>> archivenow.push("","cc",{"cc_api_key":"$YOUR-Perma-cc-API-KEY"})

Example 11

To start the server from Python do the following. The server/port number can be passed (e.g, start(port=1111, host=’localhost’)):

>>> archivenow.start()

    2017-02-09 15:02:37
    Running on
    (Press CTRL+C to quit)

Configuring a new archive or removing existing one

Additional archives may be added by creating a handler file in the “handlers” directory.

For example, if I want to add a new archive named “My Archive”, I would create a file “” and store it in the folder “handlers”. The “ma” will be the archive identifier, so to push a web page (e.g., to this archive through the Python code, I should write:


In the file “”, the name of the class must be “MA_handler”. This class must have at least one function called “push” which has one argument. See the existing handler files for examples on how to organized a newly configured archive handler.

Removing an archive can be done by one of the following options:

  • Removing the archive handler file from the folder “handlers”
  • Renaming the archive handler file to other name that does not end with “”
  • Setting the variable “enabled” to “False” inside the handler file


The Internet Archive (IA) sets a time gap of at least two minutes between creating different copies of the “same” resource.

For example, if you send a request to IA to capture ( at 10:00pm, IA will create a new copy (C) of this URI. IA will then return C for all requests to the archive for this URI received until 10:02pm. Using this same submission procedure for requires a time gap of five minutes.

File Type Py Version Uploaded on Size
archivenow-2017. (md5) Source 2017-08-09 8KB