How to set up your browser to access the Europeana APIs

While using Europeana's API suite, you'll be asked to provide an API key to be granted access. Traditionaly, you could do so by adding the wskey parameter in your API URL, however, this option is being deprecated and replaced by alternative options using HTTP Headers. If you're using an application like Postman to work on your API calls, you can easily configure your HTTP headers within the application. But if you're just using your browser to send API calls, it's not natively possible to configure an HTTP header. Luckily there are plugins available for the most popular web browsers that allow you to set and use HTTP headers whenever you're making an API call.

If you dont have an API key yet, you can register for one here: Get an API key | Europeana PRO

Using Chrome, Edge or Firefox

If you are using either Chrome, Edge, or Firefox, you can use a plugin called 'Modheader' that will allow your browser to send HTTP headers alongside the API requests. To install modheaders, go to this website and install the plugin by clicking on the 'Install Modheader' button. This will take you to the plugin store of your respective browser, where you'll be able to install the plugin. Your browser might need to be restarted for the plugin to take effect. 

Once you have installed Modheader, follow these instructions:

  1. Open the Modheader extension by clicking on the 'Modheader' icon in your plugins bar.

  2. This will open a window where you configure the extension. The first time you use it, it will show a new empty profile named “Profile 1“. You can use it if you dont need to create any additional profile, e.g. for other websites.

  3. Click on the + button at the top of the window and select “Request Header”.

  4. Configure the Name and Value columns with respectively X-API-Key and your API key.

We recommend that you also add a filter so that the browser only sends these headers when the requests are made to the Europeana APIs. You can do this in the following way:

  1. In the same window, click on the Filter button just below the header and select “Request URL filter“

  2. Change the value of the filter to .*://api.europeana.eu/.*

Finally, to guarantee that this profile is always enabled when using your browser, right-click on the icon corresponding to the profile image-20240905-140235.png and choose “Always stay on“ image-20240905-140348.png .

You can learn more about Modheader and how to create a request headers here and filters here.

 

image-20240905-140026.png
This is what your Modheader plugin interface should look like once you’ve created your HTTP header

Using Safari

Safari has a plugin called 'Requestly' where, similar to Modheader, you can create and use HTTP headers for your API calls. Go to this website and click 'download for Safari' to install the plugin. You might need to restart your browser to have the plugin take effect. To access the plugin, click on the Requestly icon in your plugins bar. Then select the 'Modify Headers' option. 

The start screen of Requestly, once you’ve clicked on it from your plugins bar

Enter a rule name. Maybe call it 'Europeana API auth' or something similar.

Add a source condition. This will activate requestly when you enter a URL that has a certain string in it. For Europeana's APIs, you can use api.europeana.eu. Then add a new rule with the Type 'Request Header. Fill in the following information:

Name: X-Api-Key
Value: your API key 

Once that's done, create your rule and you're good to go! 

Please be aware that some of our APIs use different base URLs, so they might not be included in your source condition. For the IIIF API, for instance, the base URL is 'http://iiif.europeana.eu '. You can add an extra condition to your existing rule, or add a new rule for that API URL. This last option is especially useful if you have multiple API keys that you use for different Europeana APIs.