Programmatically search nodes according to the value of fields in their bundle I am working on a script to search groups within the site according to criterias, such as group city, group languages and so on. 

So far i am trying to do this by manually querying the database though it s seems to be an unnecessary hassle since the fields i am searching all live in different table like field_data_field_city, field_data_field_language and it can get very tedious task. 

So i am wondering if i could to that programmaticaly using views so that it returns me all the NID according to the filters i mentioned above. i'd rather not use views UI as later this data is populated to the page via a Jquery templating system witch is already in place so the best would be to just get all the NID that match my selection. 

If anyone had any incite / experience on how i should go to achieve this result would be much appreciated .
Personally I would stick to writing your query manually instead of using Views. 

This way you have much more control over the final query, and in most scenarios you should be able to make it much smaller (and thus much faster) than that created by Views - by joining only with tables you really need to join in a specific situation, while Views will always do all the joins required by all possible scenarios.

Also, this way you could return the result formatted whichever way you want, without the need of installing additional modules, which is just unnecessary overhead.

IMHO. :)