How to determine whether a drug is brand or generics?

What would be the easiest way to determine brand vs. generic for thousands of different NDC codes?