Declaring code in statement based languages is (1) a set of statements, is (2) used directly or indirectly in a computer, and it is used (3) to bring about a certain result. That hits all the points listed in 17 USC 101.
This is trivial to prove. Take a program that works and remove the declaring code. The program no longer works. That shows that the declaring code is indeed being used by the computer, and it is being used to bring about a certain result.
That the declaring code is not directly used in actually calling the API is irrelevant. The "certain result" the declaring code is used to bring about is the compiler producing output that works with the API.