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

# Industry Search

> Resolve an industry from a free-text query into matching industry codes ranked by similarity.

## Overview

The Industry Search API resolves a free-text industry or topic name into a ranked list of matching industry codes. Its primary purpose is to look up the `code` needed as the `industry` parameter in the News API or List Generation API when you only have a topic name to start with, not an akta.pro industry code. This is a **free endpoint** so it does not consume API credits. **Endpoint**

```text theme={null}
GET https://api.akta.pro/api/v1/industry/search
```

Pass a `query` parameter to search, and an optional `level` parameter to restrict results to specific tiers of akta.pro industry taxonomy. The backend matches `query` against the taxonomy and returns the closest industries, ranked by similarity.

## Authentication

All requests must include an **API key** in the `x-api-key` HTTP header.

```text theme={null}
x-api-key: <YOUR_API_KEY>
```

<Warning>
  Never expose your API key in client-side code, browser requests, or public repositories. A missing or invalid key returns `401 Unauthorized`.
</Warning>

***

## Request Reference

| Parameter | Type   | Required     | Description                                                                                                                                                                                                                                                                                                                           |
| --------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`   | string | **Required** | Free-text industry name or topic (e.g. `"warehouse automation"`). The API matches this against Akta's industry taxonomy and returns the closest codes.                                                                                                                                                                                |
| `level`   | string | Optional     | One or more taxonomy levels to restrict results to. Accepts a single value or a comma-separated list (e.g. `"l4,l1"`). Available values: `l1`, `l2`, `l3`, `l4`, `all`. **Default is `l4`** — the most granular taxonomy tier. Pass `all` or a specific combination of levels to widen results to broader industry groupings as well. |

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://api.akta.pro/api/v1/industry/search?query=warehouse%20automation' \
    --header 'x-api-key: <YOUR_API_KEY>'
  ```

  ```python Python theme={null}
  import requests
  response = requests.get(
      "https://api.akta.pro/api/v1/industry/search",
      headers={"x-api-key": "<YOUR_API_KEY>"},
      params={"query": "warehouse automation"}
  )
  results = response.json()["data"]
  if results:
      top_match = results[0]
      print(f"Code:       {top_match['code']}")
      print(f"Industry:   {top_match['industry_name']}")
      print(f"Similarity: {top_match['similarity']}")
  ```
</CodeGroup>

**Searching across multiple taxonomy levels**

By default, results are restricted to `l4` (the most granular level). Pass `level` with multiple values, or `all`, to also surface broader, higher-level industry groupings in the same call:

<CodeGroup>
  ```bash cURL theme={null}
  curl -G "https://api.akta.pro/api/v1/industry/search/?query=warehouse+automation&level=l4%2Cl1" \
    -H "x-api-key: <YOUR_API_KEY>"
  ```

  ```python Python theme={null}
  import requests
  response = requests.get(
      "https://api.akta.pro/api/v1/industry/search",
      headers={"x-api-key": "<YOUR_API_KEY>"},
      params={"query": "warehouse automation", "level": "l4,l1"}
  )
  results = response.json()["data"]
  for match in results[:5]:
      print(match["code"], match["industry_name"], match["similarity"])
  ```
</CodeGroup>

***

## Response

### Response envelope

```json theme={null}
{
  "data": [
    {
      "code": "IMAHAHAN",
      "industry_name": "Warehouse & Intralogistics Automation Systems (AS/RS, Sortation, Conveyance Controls)",
      "similarity": 0.6098
    },
    {
      "code": "IMAHABAK",
      "industry_name": "Warehouse Automation Systems (AS/RS, Shuttle Systems, Vertical Lift Modules)",
      "similarity": 0.6026
    }
  ],
  "count": 2,
  "credits_consumed": 0
}
```

| Field              | Type      | Description                                                                                                 |
| ------------------ | --------- | ----------------------------------------------------------------------------------------------------------- |
| `data`             | object\[] | Array of matching industry objects, ranked by similarity score. Empty array `[]` when no results are found. |
| `count`            | integer   | Number of industry objects returned in the `data` array.                                                    |
| `credits_consumed` | float     | Always `0` — this is a free endpoint.                                                                       |

### Industry object

| Field           | Type   | Description                                                                                                                                                                 |
| --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`          | string | Unique Akta industry code. Pass this as the `industry` parameter in the News API.                                                                                           |
| `industry_name` | string | Full name of the industry as per Akta's industry taxonomy.                                                                                                                  |
| `similarity`    | float  | Similarity score between the query and the matched industry, from `0` to `1`. Higher values indicate a closer match. Results are returned in descending order of relevance. |

***

## Using the code in other APIs

Once you have the `code`, pass it as the `industry` field in downstream API calls:

```python theme={null}
import requests
HEADERS = {"x-api-key": "<YOUR_API_KEY>"}
# Step 1: Search for the industry
search = requests.get(
    "https://api.akta.pro/api/v1/industry/search",
    headers=HEADERS,
    params={"query": "warehouse automation"}
)
code = search.json()["data"][0]["code"]
# Step 2: Use the code in the News API
news = requests.get(
    "https://api.akta.pro/api/v1/news",
    headers=HEADERS,
    params={"industry": code, "limit": 10}
)
print(f"Found {news.json()['total']} articles")
```

<Tip>
  If a query matches several closely related industries, consider passing more than one `code` to the News API's `industry` parameter (comma separated) to widen coverage, rather than relying on the single top match.
</Tip>

<Tip>
  If the default `l4` results feel too narrow or too specific for your use case, pass `level=all` (or a specific combination like `level=l3,l4`) to also pull in broader taxonomy groupings before deciding which `code`(s) to use downstream.
</Tip>
