So this is my understanding of what you are doing:
You are setting page-level custom variables (important technical note: they must be called before calling _trackPageview or another call, otherwise they will not be tracked.)
Your code might look something like this:
_gaq.push(['_setCustomVar', 2, 'Brand', 3]);
Now, when you request the Google Analytics API, itβs important to note that slot # is very important because access to the slot is explicitly specified in the request.
So, for this you will need to set your sizes in ga:customVarName2 and ga:customVarValue2 , and decide which metric you are interested in getting. You specify page types, so use ga:pageviews . (You are by no means limited to viewing pages. You can use any metric, except for a pair specific to AdWords.)
This query will return you the entire user variable from this slot and the number of pageviews associated with them.
You also mentioned that you want to be able to filter by value.
You would do this by setting the filter value to something like ga:customVarValue2==Apple .
You can see what a type query looks like in the query explorer .
Here is an example screenshot: 
Finally, for all Analytics API requests, the default date range is set so that you can request it yourself.
All you have to do is decide which library you want to use as an interface, and you are ready to go.