> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://open-api-docs.dice.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://open-api-docs.dice.tech/_mcp/server.

# Search Expense Category

GET https://heimdall.eka.io/apis/external/search/searchExpenseCategory

### Endpoint: Search Expense Category

This endpoint allows users to search for expense categories based on a query parameter. It is particularly useful for retrieving specific categories related to expenses, such as allowances, travel costs, and other financial classifications.

#### HTTP Method

`GET`

#### Request Parameters

* **q** (string, required): The search query for the expense category. In this case, it is used to filter categories based on user input. For example, `q=Daily Allowance` will search for categories related to daily allowances.

#### Example Request

```
GET {{host}}/apis/external/search/searchExpenseCategory?q=Daily Allowance

```

#### Response Structure

The response will return a JSON object containing the following structure:

* **categories** (array): An array of category objects matching the search query.

  * Each category object includes:

    * **id** (integer): The unique identifier for the category.

    * **name** (string): The name of the category.

#### Example Response

```json
{
  "categories": [
    {
      "id": 0,
      "name": ""
    }
  ]
}

```

This response indicates that the search has been executed, returning an array of categories that match the provided query. If no categories are found, the array may be empty.

Reference: https://open-api-docs.dice.tech/dice-standardized-ap-is-v-2-copy/search/search-expense-category

## Servers

- `https://heimdall.eka.io` (https://heimdall.eka.io, default)
- `https://heimdall.eka.ioapis` (https://heimdall.eka.ioapis)

## Request

### Query parameters

- `q` (string, optional) — Fetches expense categories matching the q parameter using a case-insensitive partial match on the category name. If q is blank, an empty response is returned.

### Headers

- `DICE-APP-ID` (string, optional)
- `X-CLIENT-ID` (string, optional)
- `X-CLIENT-SECRET` (string, optional)

## Response

### 200

OK

- `categories` (list of object, required)
  - `id` (integer, required)
  - `name` (string, required)

## Examples

**Response**

```json
{
  "categories": [
    {
      "id": 2766,
      "name": "Daily Allowance"
    },
    {
      "id": 2792,
      "name": "Daily Allowance (Sunday)"
    },
    {
      "id": 2798,
      "name": "Daily Allowance Expense"
    }
  ]
}
```

**SDK Code**

```python Search_Search Expense Category_example
import requests

url = "https://heimdall.eka.io/apis/external/search/searchExpenseCategory"

querystring = {"q":"Daily%20Allowance"}

headers = {
    "DICE-APP-ID": "KARANDEVENV",
    "X-CLIENT-ID": "0f1da16de",
    "X-CLIENT-SECRET": "fffb8d449bcf4b11850d0ef4271c1a7b"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Search_Search Expense Category_example
const url = 'https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance';
const options = {
  method: 'GET',
  headers: {
    'DICE-APP-ID': 'KARANDEVENV',
    'X-CLIENT-ID': '0f1da16de',
    'X-CLIENT-SECRET': 'fffb8d449bcf4b11850d0ef4271c1a7b'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Search_Search Expense Category_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("DICE-APP-ID", "KARANDEVENV")
	req.Header.Add("X-CLIENT-ID", "0f1da16de")
	req.Header.Add("X-CLIENT-SECRET", "fffb8d449bcf4b11850d0ef4271c1a7b")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Search_Search Expense Category_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["DICE-APP-ID"] = 'KARANDEVENV'
request["X-CLIENT-ID"] = '0f1da16de'
request["X-CLIENT-SECRET"] = 'fffb8d449bcf4b11850d0ef4271c1a7b'

response = http.request(request)
puts response.read_body
```

```java Search_Search Expense Category_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance")
  .header("DICE-APP-ID", "KARANDEVENV")
  .header("X-CLIENT-ID", "0f1da16de")
  .header("X-CLIENT-SECRET", "fffb8d449bcf4b11850d0ef4271c1a7b")
  .asString();
```

```php Search_Search Expense Category_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance', [
  'headers' => [
    'DICE-APP-ID' => 'KARANDEVENV',
    'X-CLIENT-ID' => '0f1da16de',
    'X-CLIENT-SECRET' => 'fffb8d449bcf4b11850d0ef4271c1a7b',
  ],
]);

echo $response->getBody();
```

```csharp Search_Search Expense Category_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance");
var request = new RestRequest(Method.GET);
request.AddHeader("DICE-APP-ID", "KARANDEVENV");
request.AddHeader("X-CLIENT-ID", "0f1da16de");
request.AddHeader("X-CLIENT-SECRET", "fffb8d449bcf4b11850d0ef4271c1a7b");
IRestResponse response = client.Execute(request);
```

```swift Search_Search Expense Category_example
import Foundation

let headers = [
  "DICE-APP-ID": "KARANDEVENV",
  "X-CLIENT-ID": "0f1da16de",
  "X-CLIENT-SECRET": "fffb8d449bcf4b11850d0ef4271c1a7b"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/search/searchExpenseCategory?q=Daily%2520Allowance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```