JSON API for Dataset Arte Electrónico Argentino
A very simple RESTful JSON API to query the dataset curated by @cristianReynaga, you can read more about it here (in spanish).
This API is built using Golang and SQLite3. I also provide a sanitised csv file ready to be imported to a sqlite db (with the necessary statements to ease the process).
This is a WIP with the intention to have a quick way to access this information and to keep learning golang :-)
It's publicly accessible here (For now
How to ...?
$ docker pull lvm23/api-arte-electronico-argentino $ docker run -d -p 8080:8080 lvm23/api-arte-electronico-argentino
$ git clone https://github.com/lvm/api-dataset-arte-electronico-argentino $ cd api-dataset-arte-electronico-argentino/
Then, create the SQLite database
$ rm -f db/electronicArtArgentina.sqlite3 $ cd data $ cat csv-to-sqlite | sqlite3 ../db/electronicArtArgentina.sqlite3
For testing purpose, to build the API (I recommend using the official golang image) you need to execute
$ export GOPATH=$HOME $ go get . $ go run
api.go reads a couple of extra enviroment vars:
If everything went OK, you should see something like
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. - using env: export GIN_MODE=release - using code: gin.SetMode(gin.ReleaseMode) [GIN-debug] GET //exhibitions --> main.GetExhibitions (4 handlers) [GIN-debug] GET /exhibitions/:e_id --> main.GetExhibition (4 handlers) [GIN-debug] GET /search --> main.SearchExhibitions (4 handlers) [GIN-debug] OPTIONS /exhibitions --> main.EndpointsOptions (4 handlers) [GIN-debug] OPTIONS /exhibitions/:e_id --> main.EndpointsOptions (4 handlers) [GIN-debug] OPTIONS /search --> main.EndpointsOptions (4 handlers) [GIN-debug] Listening and serving HTTP on :8080
and you can start querying the API.
Note: If you export the
GIN_MODE=release env var, those debug messages won't be displayed but it's recommended for production.
Also, you can take a look at the Dockerfile to get an idea of the steps required.
For the moment, there are two endpoints:
search. It accepts only
List all available endpoints
This method allows to query all of them or just one.
List all (around 15xx) exhibitions
To retrieve more items, use the
Just one by passing the ID
This method allows to search, primarily by the exhibition's name and then you can pass more parameters to narrow your search. These extra parameters use the
AND operator when building the query.
||The full name or a part of the name of an exhibition. Can be any
||The valid format would be
||The name of a technique, can be any
||The name of a curator, can be any
||The name of an artist, can be any
||The name of the work, can be any
||The page #. Each page shows 20 items.|
List all exhibitions with
festival on its name
...curated by Graciela Taquini
...artist Joanna Rytel
...with the word
sheep on its name
- Pagination: cleaner way to create the
- Pagination: Optimize SQLite (drop
- Search by person (artists or curators)