Skip Header

You are using a version of browser that may not display all the features of this website. Please consider upgrading your browser.

How can I (programmatically) obtain the number of results returned by my query?

If you are accessing UniProt programmatically, using our REST API, and are just interested in the number of entries returned by your query, but not in downloading or listing all the hits, you can check the X-Total-Results header like in the PERL code example Download all UniProt sequences for a given organism in FASTA format.

This returns the entry count, allowing you to count the hits without actually retrieving them.

See also:
REST API – Access the UniProt website programmatically

We'd like to inform you that we have updated our Privacy Notice to comply with Europe’s new General Data Protection Regulation (GDPR) that applies since 25 May 2018.

Do not show this banner again
UniProt is an ELIXIR core data resource
Main funding by: National Institutes of Health