Creating Search API key

When configuring your Search widget, the important step is to add your API Key to it. This article aims to provide an easy guide on how to create this API Key and add it to your widget.

In this article

Creating API key

1
To get your API key, first go to the Custom Search Introduction section and click Get a Key:
2
A popup window will appear prompting you to input a new project name. Ensure that you click Yes to accept the Terms of Service, and then proceed by clicking Next:
3

All done! Click Show Key and copy it:

4
Finally, paste the copied API Key into your widget:
Custom Search JSON API provides 100 search queries per day for free. You can learn more about it here. If you need more, you may sign up for billing in the API Console. Additional requests cost $5 per 1000 queries, up to 10k queries per day.

Restricting your API key

To restrict your API Key, please go to the API Console:

To get more information on why it's important to restrict your API Key, please refer to the following article - Restrict API keys

Here, you can either limit websites (HTTP referrers), web servers (IP addresses), or mobile apps which can use it. You might want to make your API key accessible for your own domain and Elfsight apps only. In this case, simply add  *.elfsight.com/* and your domain name, like illustrated on the below screenshots:

Please keep in mind that you need to change the way a referrer's inserted depending on the URLs which will use the key. Kindly adhere to the instructions provided on the left side of the page:

You can do the same thing for IP addresses and mobile apps as well. 

Well done! Now you can continue configuring your Search widget.

Did this article answer your question? Share your feedback: Thanks for sharing your feedback. It helps us grow! There was a problem submitting your feedback. Please try again later.

Still looking for assistance? Contact Us Contact Us