It returned 3,437 results for me, but this will include inactive companies and chains, and exclude unincorporated shops. Tax records might be more thorough, if there are a lot of unincorporated companies or sole traders that file tax returns, but I don't think those records are public.
Companies House has a publicly searchable list of incorporated companies:
https://find-and-update.company-information.service.gov.uk/
The Standard Industrial Classification (SIC) code for "retail sale of books in specialised stores" is 47610:
https://resources.companieshouse.gov.uk/sic/
You can search the list by "nature of business" (i.e. SIC code):
https://find-and-update.company-information.service.gov.uk/a...
It returned 3,437 results for me, but this will include inactive companies and chains, and exclude unincorporated shops. Tax records might be more thorough, if there are a lot of unincorporated companies or sole traders that file tax returns, but I don't think those records are public.