API.Bible Logo

Documentation Navigation

Authentication

Overview

In this quick tutorial, we'll cover everything you need to authenticate your calls with our API.


Find your API key

API Key Location

Your API key is easily located within your account at API.Bible:

  1. First, log in here.
  2. After logging in, you are redirected to your dashboard. If you are unsure, you can always click "API Product" in the navigation, then "Dashboard" in the dropdown.
  3. Your key will be in the top right corner of your dashboard.

Note: Because your API key is unique to your account, do not share this key anywhere and secure it appropriately in your codebase.


Test your API key

Now that you have your key, let's test it out in a real API call. Since authenticating your calls works the same across all requests, you can reference this for future requests should you run into any issues with authentication.

Here's a cURL request that fetches all Bibles your account has access to:

curl --request GET \
--url https://rest.api.bible/v1/bibles \
--header 'api-key: YOUR_API_KEY'

Essentially, our authentication uses a variation of HTTP Basic Auth. In each request you make, you'll want to place your API key in the header of the request, like this: ---header 'api-key: YOUR_API_KEY'

Here's how this request might look in vanilla Javascript:

const res = await fetch("https://rest.api.bible/v1/bibles", {
headers: { "api-key": "YOUR_API_KEY" },
});
const data = await res.json();
console.log(data);

And that's it! You should now be set to authenticate every request you make with our API. Up next, we'll discuss a few common questions developers have when starting out with API.Bible.