Have you had a look a the docs already?
The parts about the API are pretty good imo, and more or less show you everything you need for basic queries with some filters. You just have to adapt the examples to what you want.
What you need is a query for
hosts with attributes
address and a
filter to the hosts addresses belonging to that VLAN.
You basically have all that right in the first example about parameters and just have to adjust that:
API filters: Api - Icinga 2
API querying objects: Api - Icinga 2
There are examples for query URLs as well as examples for queries in a JSON objects in the body.
Also you have example code for different programming languages: