# filterarray: Filter an Array by an Operator

> filterarray (Filter an Array by an Operator) is a 1001fx API function in the group Arrays: POST https://api.1001fx.com/array/filterarray, 2 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Filters an array by an given comparison operator.

- Group: Arrays
- Endpoint: `POST https://api.1001fx.com/array/filterarray`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 2 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/filterarray

## Parameters

- `data` (array<object>, required) – Data: Array of lines with mixed values.
- `queryField` (string, required) – Query field: Name of the field in data to look for critera. Case sensitive
- `operator` (enum, optional, one of `eq`, `gt`, `ge`, `lt`, `le`, `ne`, default `eq`) – Operator: Comparison operator. Defaults to eq
- `criteria` (string, required) – Criteria: Criteria to look for must be number or string
- `ignoreCase` (boolean, optional, default `false`) – Ignore case sensitivity: Sets case sensitivity for operation.

## Example: Equal comparison

```bash
curl -X POST 'https://api.1001fx.com/array/filterarray' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"data":[{"Column1":"Germany","Column2":"Apple","Column3":1,"Column4":true},{"Column1":"Germany","Column2":"apple","Column3":2,"Column4":true},{"Column1":"US","Column2":"Apple","Column3":3,"Column4":true}],"queryField":"Column3","operator":"eq","criteria":3,"ignoreCase":false}'
```

Answer (HTTP 200):

```json
{
  "result": [
    {
      "Column1": "US",
      "Column2": "Apple",
      "Column3": 3,
      "Column4": true
    }
  ]
}
```
