2 Answers
2

Apple actually provides an RSS feed generator for apps. You could write a script to request the feeds and builds data based on the results. Might not be 100% what you're looking for, but seems like a good place to start. Its a tool provided by Apple, and its public information so you shouldn't have any issues.

IDs are in the feed. Here is something I pulled from the top 10 paid business mac apps:

The iTunes, App Store, iBookstore, Mac App Store affiliate program offers a dump of the meta data for every piece of content in the store. This is updated weekly, then daily incremental changes are published.