I've built a platform that passes a flight through a logic flow diagram to arrive at the correct cost. Sometimes it's very simple,
Most of the time, here in the UK (and the EU) it's easy to find airport cost information by searching for their 'Schedule of Charges'. You normally find a PDF document outlining the costs pretty clearly, from where you can build the logic diagram that 'powers' the (free to use) app.
I'd be interested to know what if any similar conventions exist outside of the UK/EU, or if anyone has any tips on sourcing such data.