Need to generate Flat files

I have been using the API to drive data into our dashboarding tool that does a mashup. I need the API string to pull the following in flat format:

Site ID, Page Titles, Visits to page title

Site ID, Locations, Visits from Location

I have about 20 sites running on piwik.

Thanks in advance…