A similar question was asked on Stack Overflow: https://stackoverflow.com/a/2899086/178673 (and marked off-topic, but it did have some answers)
When you are booking a flight, you are typically providing more information than just the flight number, in fact, the query is usually "here is my date/time and arrival/departure information, what is available?"
You are providing the departure date (or range) and arrival date (or range), as well as the city-pairs, and when you have that data you can use the API from FlightStats to find out the list of flights: https://developer.flightstats.com/api-docs/scheduledFlights/v1
If you just knew the flight number, you could use the API call for "Scheduled Flight(s) by carrier and flight number, departing on the given date. /v1/json/flight/{carrier}/{flightnumber}/departing/{year}/{month}/{day}, but again, you still need something to put in as either the departing or arrival date.
Programmatically, perhaps if it didn't return a hit for the date you specified, you could search on x days of either side of the date. For example, October 19, 2014 didn't return a hit for LH2014 (I know this is a daily, Monday-Friday flight), and the API would return that it didn't hit, so then we (arbitrarily in this example) check two days on either side
Psuedo-code example:
day = 19
/v1/json/flight/LH/2014/departing/2014/10/{day-2}
/v1/json/flight/LH/2014/departing/2014/10/{day-1}
/v1/json/flight/LH/2014/departing/2014/10/{day+1}
/v1/json/flight/LH/2014/departing/2014/10/{day+2}
And find out that it is scheduled on the 17, 20 and 21 of October and that it flies MUC-DUS, in an A319/20.
So, the API isn't going to do all the work for you, but you could probably wrangle the API to give you the information you want in a format you want. With some built-up logic around the question you're really trying to ask and multiple API calls (Is this flight number available on this date and what are the city-pairs, and if it's not available what date(s) is it available?).
Hope this is helpful. :)