It depends on the context. No matter what you are talking about both are ok the second is more natural. If you wanted to know the number of a specific animal, for instance pandas, you would say "How many endangered animals are there?" or "How many endangered pandas are there?" However, if you what to know how many types of animals there are endangered (pandas, lions, birds, and so on) you would say "How many endangered species are there?"