> ## Documentation Index
> Fetch the complete documentation index at: https://docs.northaxiumdata.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Universal Search

> Search across all federal datasets simultaneously.

Perform a global text search to find references to a specific company, individual, or query across contracts, lobbying, grants, contributions, and parliament.

### Query Parameters

<ParamField query="q" type="string" required>
  The search term or phrase (e.g., `"Green Energy"`, `"Jane Doe"`). Example: `Palantir`.
</ParamField>

<ParamField query="results_per_domain" type="integer" default="5">
  Maximum number of results to return per dataset group. Example: `5`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.northaxiumdata.ca/api/v1/search?q=Green+Energy&results_per_domain=5" \
    -H "X-API-Key: <your-api-key>"
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.northaxiumdata.ca/api/v1/search"
  headers = {"X-API-Key": "<your-api-key>"}
  params = {
      "q": "Green Energy",
      "results_per_domain": 5
  }

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

  ```javascript Node.js theme={null}
  const fetch = require('node-fetch');

  const url = new URL('https://api.northaxiumdata.ca/api/v1/search');
  url.search = new URLSearchParams({
    q: 'Green Energy',
    results_per_domain: '5'
  });

  fetch(url, {
    headers: {
      'X-API-Key': '<your-api-key>'
    }
  })
    .then(res => res.json())
    .then(json => console.log(json));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "contracts": {
        "total": 12,
        "results": [
          {
            "record_id": "CON-8841-A",
            "dataset": "contracts",
            "label": "Green Energy Co. — Solar Panel Installation",
            "url": "/api/v1/contracts/CON-8841-A"
          }
        ]
      },
      "lobbying": {
        "total": 3,
        "results": [
          {
            "record_id": "812039-12345",
            "dataset": "lobbying",
            "label": "Green Energy Solutions Corp.",
            "url": "/api/v1/lobbying/communications/812039-12345"
          }
        ]
      }
    },
    "meta": {
      "q": "Green Energy",
      "results_per_domain": 5,
      "domains_with_results": 2
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "BAD_REQUEST",
      "message": "Invalid parameter value."
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Missing API key. Pass your key in the X-API-Key header."
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "NOT_FOUND",
      "message": "The requested resource was not found."
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": "RATE_LIMITED",
      "message": "Monthly request limit exceeded."
    }
  }
  ```
</ResponseExample>
