Skip to content

gojibjib/gopeana

Repository files navigation

godoc badge Go Report Card Build Status

An Europeana Search API client written in Go

Europeana is a European collection of over 50 million digitised items. The Search API provides a programmatic way to access those resources. Make sure to get an API key first.

Inspired by go-xkcd.

Repo layout

The complete list of JibJib repos is:

  • jibjib: Our Android app. Records sounds and looks fantastic.
  • deploy: Instructions to deploy the JibJib stack.
  • jibjib-model: Code for training the machine learning model for bird classification
  • jibjib-api: Main API to receive database requests & audio files.
  • jibjib-data: A MongoDB instance holding information about detectable birds.
  • jibjib-query: A thin Python Flask API that handles communication with the TensorFlow Serving instance.
  • gopeana: A API client for Europeana, written in Go.
  • voice-grabber: A collection of scripts to construct the dataset required for model training

Install

$ go get github.com/gojibjib/gopeana

Example

package main

import (
	"encoding/json"
	"fmt"
	"github.com/gojibjib/gopeana"
	"log"
)

func main() {
	apiKey := "XXXXX"
	client := gopeana.NewClient(apiKey, "")
	   	
	// Returns all results for 'Mona Lisa' with an open license.
	request, err := gopeana.NewBasicSearchRequest(client, "open", "standard", "12", "1")
	if err != nil {
		log.Fatal(err)
	}
		
	resp, err := request.Get("mona+lisa")
	if err != nil {
		log.Fatal(err)
	}
	   	
	// Web search: https://www.europeana.eu/portal/de/search?q=mona+lisa&f%5BREUSABILITY%5D%5B%5D=open
	// API search: https://www.europeana.eu/api/v2/search.json?wskey=XXXXX&reusability=open&query=mona+lisa
	fmt.Println(resp)
}