Skip to content

Python API Client Example

This example demonstrates how to send an authenticated HTTP request to the Core API using the requests library.

The example performs a GET request using Bearer token authentication.


Installation

Install the required dependency before running the example:

pip install requests

Example Request

import requests

BASE_URL = "https://website.core-software.co.uk"
TOKEN = "YOUR_TOKEN_HERE"

headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Content-Type": "application/json",
}

response = requests.get(
    f"{BASE_URL}/api/v1",
    headers=headers,
)

print(response.status_code)
print(response.json())

Notes

  • Replace YOUR_TOKEN_HERE with a valid API token before running the example
  • Authentication is provided using the Authorization: Bearer header
  • The response status code and parsed JSON body are printed to the console
  • Error handling has been omitted for simplicity