Flights out of London Heathrow do not contain departure gate information until about 45 minutes before the flight is ready to depart (presumably so you spend more money at the duty-free). Are there any public API's or resources that will tell me which gate my flight departs from before the Heathrow departure screens do?
This is because flights are not assigned gates until the inbound flight has landed. In case the inbound flight is delayed, the gate that is nominally reserved for it, gets assigned to someone else. This is all about managing the (at times incredibly busy) traffic on the ground around the airport.
They could announce the nominally assigned gate, of course, but then they would frequently have to announce gate changes, with resultant confusion. It is simpler for the aiport to only announce gates once the assignment is very unlikely to change (i.e. the plane is already there).
So to answer your question; No, you can't do that.
I don't know about the other terminals, because I don't visit them often enough, but for Terminal 5 the gate is normally known to BA about 1.5 hours in advance of departure. I say normally, because if there's disruption (weather, inbound flight is late etc) things can change and it won't be confirmed. However, most cases (let's say at least 80%), BA will know at checkin time.
T5 is a little special, because it has 3 parts to it, T5A (directly attached landside), T5B and T5C (which has no lounges). At checkin, if you ask, they can almost always tell you which bit of T5 your flight will leave from, so you know which lounge to head for (assuming you have lounge access). They won't always tell you the exact gate then, however, if you ask when you check into the lounge they'll either tell you the gate, or tell you when they can tell you the gate. The lounge staff are normally able to tell you the gate number at least 30 minutes before it shows on the board. (They have to look it up in a different system though, it doesn't flash up when they scan your boarding card to let you in)
So, my advice is to ask about the gate at checkin, and see if they can look it up then. If not, clear security, then ask either the lounge staff (if you have access), or the airport information (if not). They ought to be able to look it up on the airport system and tell you.
For most parts of Heathrow, heading to the wrong bit of the terminal just means a 10-15 minute walk. For some bits, it can mean having to re-clear security and wait for a shuttle train, so it's worth double checking before you say head to T5C only to find your flight goes from T5A....