Ask HN: API to get flight prices and info?

I wonder where do startups like Hipmunk (specially when they first started) or Trabber get their data? I asked the latter and they replied they couldn't tell. Seems like too many variables and changing too quickly (prices) as to be scrapped. Do they scrape when you perform a search? Is there any API that gives you that info for a lot of airlines? If so, is it free or you have to pay for it? Or do they negotiate with each airline independently?