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:
<id im:id="546392952" im:bundleId="com.creaceed.mas.prizmo2">