# Guide

Welcome to the **DataGardener API**. Our API provides instant access to UK company intelligence including company profiles, directors, shareholders, financials, group structures, and more.

## **Steps to get started:**

### **1. Obtain Your API Key**

1) **Contact sales**

- Reach out to our sales team by [booking a demo](https://datagardener.com/demo/) to access DataGardener's API.

- Request API access for your environment (sandbox or         production).

2) **Receive your key**

- You’ll be issued a secure API key (e.g., dg_test_xxxxxx).

- Keep this key safe — treat it like a password.
<hr>

### **2. Configure Your API Key**

There are multiple ways to set your key depending on your environment:

**Option A: Environment Variable (Recommended)**
```
# Linux / macOS
export x-api-key = "your_api_key_here"

# Windows (PowerShell)
setx x-api-key "your_api_key_here" 
```
**Option B: Store in a Configuration File**
Example .env file:
```
x-api-key = your_api_key_here
```
### **3. Set the Authorisation Token**
Every request must include the Authorisation header:

```
x-api-key :  YOUR_API_KEY
```

**Example (cURL)**

 
<Accordion title="bash" defaultOpen>
  You can put other components inside Accordions.
  ```
curl -X GET "https://api.datagardener.com/companies/01234567" \
       -H "x-api-key : YOUR_API_KEY"
 
  ```
</Accordion>

**Example (JavaScript / Node.js)**


<Accordion title="javascript" defaultOpen>
  You can put other components inside Accordions.
  ```
    const axios = require("axios");

const x-api-key = process.env.DG_API_KEY;

axios.get("https://api.datagardener.com/companies/01234567", {
  headers: { x-api-key: `${API_KEY}` }
})
.then(res => console.log(res.data))
.catch(err => console.error(err));
  ```
</Accordion>

**Example (Python)**


<Accordion title="python" defaultOpen>
  You can put other components inside Accordions.
  ```
    import requests
import os

API_KEY = os.getenv("DG_API_KEY")

url = "https://api.datagardener.com/companies/01234567"
headers = {"x-api-key": f"{API_KEY}"}

response = requests.get(url, headers=headers)
print(response.json())

  ```
</Accordion>


### **4. Verify Your Setup**
A successful call returns a **200 OK** response with company data:

<Accordion title="Example Response" defaultClosed>
  
  ```
  {
     "companyRegistrationNumber": "string",
     "businessName": "string",
     "companyRegistrationDate": "string",
     "businessAlphaName": "string",
     "companyStatus": "string",
     "companyLiquidationStatus": "string",
     "administrationOrderFlag": "string",
     "voluntaryAgreementFlag": "string",
     "inAdministrationFlag": "string",
     "receiveManagerFlag": "string",
     "latestAnnualReturnDate": "string",
     "nextAnnualReturnDate": "string",
     "accountsFilingDate": "string",
     "latestDateOfAccounts": "string",
      "bankDetails": [
          {}
            ],
      "charityNumber": "string",
      
       "sicCode2": {
       "sicNumber1": "string",
       "sicText1": "string"
           },
    "regAddress": {
    "addressLine1": "string",
    "addressLine2": "string",
    "addressLine3": "string",
    "addressLine4": "string",
    "postalCode": "string",
    "telephone": "string",
    "ctps": "string",
    "website": "string",
    "regPOBox": "string",
    "county": "string",
    "regCareOfAddress": "string",
    "regOfficeAreaCode": "string",
    "country": "string",
    "ward": "string",
    "constituency": "string",
    "region": "string",
    "postcode_area": "string",
    "postcode_district": "string",
    "district": "string",
    "police_force": "string",
    "linkedin_url": "string",
    "facebook_url": "string"
  },
         
     .
     .
     . and more 
                 }
  ```
</Accordion>

### **5. Next Steps**

- Try other endpoints like Financials or Directors to enrich your workflows.

- Integrate the API into your CRM, loan decision engine, or procurement system.


