Skip to main content

Developers Query Language(DQL)

The Developers Query Language (DQL) is an API feature that lets you use query clauses in the query parameters of a listing request, offering extended functionality compared to standard filters.

To find out whether an API has DQL implemented, visit its endpoint in the API reference and check whether it has the following type of notice:

📘 Developers Query Language (DQL)

This endpoint supports requests using the Developers Query Language (DQL).

FieldsOperators
accountIdin
datelt, gt

Query clauses​

A query clause is the name given to the smallest unit used by DQL to perform a query on an API that supports it.

A query clause can be divided into 3 parts:

  • Field
  • Operator
  • Value

Field​

The field is the property to which the operation described in the Operator will be applied.

Operator​

The operator is the logical unit of the clause, indicating which operation should be performed using the Value on the Field.

OperatorDescription
gtGreater than - This operator queries only values greater than the one provided
ltLess than - This operator queries only values less than the one provided
inIn - This operator queries only values provided in, or contained in, the list

Value​

The value is the part of the clause that specifies a value or a list of values separated by commas to be used when applying the Operator on the specified Field.

Clause format​

A query clause takes the form Field:Operator=Value and is always used as a query parameter.

For example:

curl --request GET \
--url 'https://api.uat.empresas.btgpactual.com/37297902000141/banking/accounts/statements?date%3Alt=2024-07-16&date%3Agt=2024-06-09&accountId%3Ain=37297902000141-208-50-009999990' \
...

In this request, we can see three clauses in use, each using a different operator:

  • date:lt=2024-07-16
  • date:gt=2024-06-09
  • accountId:in=37297902000141-208-50-009999990

Where:

UnitValue
Clausedate:lt=2024-07-16
Fielddate
Operatorlt
Value2024-07-16
ResultFilters the request for results with a date earlier than 2024-07-16
UnitValue
Clausedate:gt=2024-06-09
Fielddate
Operatorgt
Value2024-07-16
ResultFilters the request for results with a date later than 2024-06-09
UnitValue
ClauseaccountId:in=37297902000141-208-50-009999990
FieldaccountId
Operatorin
Value37297902000141-208-50-009999990
ResultFilters the request for results with accountId equal to 37297902000141-208-50-009999990