Skip to main content

Authentication

The Beagle Database API uses HTTP Basic Authentication. Use the same username and password that you use to log in to the Beagle web application.

Always call the API over HTTPS to protect credentials in transit.


Required Headers

Authorization: Basic <base64_encoded_credentials>
Accept: application/json

Example Code (NodeJS)

const axios = require("axios");

const url =
"https://www.beagledatabase.co.za/api/companies?vat_number=412345678";

const response = await axios.get(url, {
auth: {
username: process.env.API_USERNAME,
password: process.env.API_PASSWORD,
},
});

console.log("Response:", response.data);

Notes

  • Use your Beagle web app username and password.
  • Use HTTPS for all API requests.
  • If credentials are invalid, the API returns an authentication error.