This JAVA/GSON test program prints out the air quality for a town of city. You need two things: an api key and the coordinates for the town. Get an api key from here: http://aqicn.org/api/
Once you have an api key (token) then you can search for a town in your browser by entering this.
https://api.waqi.info/search/?token='yourToken'&keyword='yourTown' (without the '') The result will contain the coordinates of the station you need to put in the programme. Good luck.
This is confusingly outlined here: http://aqicn.org/json-api/doc/