Python 3 Flask application to search the catalog.
- Python 3.10
$ catalog-searcher --help
Usage: catalog-searcher [OPTIONS]
Run the catalog searcher web app using the waitress WSGI server
Options:
-l, --listen [HOST]:PORT Port (and optional host) to listen on. Defaults to
"0.0.0.0:5000".
-t, --threads INTEGER Maximum number of threads to use. Defaults to 10.
-V, --version Show the version and exit.
--help Show this message and exit.
- Root
- Path:
/
- Methods:
GET
- Response (to all requests):
- Status:
200 OK
- Content-Type:
application/json
- Body:
{status: ok}
- Status:
- Path:
- Ping
- Path:
/ping
- Methods:
GET
- Response (to all requests):
- Status:
200 OK
- Content-Type:
application/json
- Body:
{status: ok}
- Status:
- Path:
- Search
- Path:
/search
- Methods:
GET
- Parameters:
q
(Required): text of the queryendpoint
(Optional): selects the type of search:books-and-more
orarticles
; defaults tobooks-and-more
page
(Optional): page of results to display; defaults to0
per_page
(Optional): number of results to display on each page; defaults to3
backend
(Optional): catalog backend implementation to use:alma
,primo
, orworldcat
; defaults toprimo
- Responses:
- Success:
- Status:
200 OK
- Content-Type:
application/json
- JSON Schema: api-response-schema.json
- Status:
- Error: Missing or invalid request parameters
- Status:
400 Bad Request
- Content-Type:
application/json
- Status:
- Error: Problem contacting the backend or executing the search
- Status:
500 Internal Server Error
- Content-Type:
application/json
- Status:
- Success:
- Path:
curl 'http://localhost:5000/search?q=cheese+making&per_page=3&page=2'
{
"endpoint": "world_cat_discovery_api_article",
"first_page": "http://localhost:5000/search?q=cheese+making&per_page=3&page=1",
"last_page": "http://localhost:5000/search?q=cheese+making&per_page=3&page=62015",
"next_page": "http://localhost:5000/search?q=cheese+making&per_page=3&page=3",
"page": 2,
"per_page": 3,
"prev_page": "http://localhost:5000/search?q=cheese+making&per_page=3&page=1",
"query": "cheese making",
"results": [
{
"author": "Francis T. Bond",
"date": "1905",
"format": "article",
"link": "https://www.jstor.org/stable/20286827",
"title": "Cheese-Making"
},
{
"author": "Muiris O’Sullivan",
"date": "2018",
"format": "article",
"link": "https://www.jstor.org/stable/26565827",
"title": "CHEESE-MAKING"
},
{
"author": "null",
"date": "2019",
"format": "article",
"link": "https://umaryland.on.worldcat.org/oclc/8100216678",
"title": "Cheese Making"
}
],
"total": 186043
}
See the LICENSE file for license rights and limitations.