Cannot get alphabetic-search to work (always 404)

I am trying to find a company through alphabetic search.

This is an example company id: 07307709 name: “AHIMSA DAIRY FOUNDATION”, which existence is confirmed by the company API

curl -s -XGET -u my_api_key: https://api.company-information.service.gov.uk/company/07307709 | jq '.company_name'
"AHIMSA DAIRY FOUNDATION"

however when I am trying to search for “AHIMSA” or “AHIMSA DAIRY FOUNDATION” through /alphabetic-search/companies I am always getting an empty list

curl -s -XGET -u my_api_key: "https://api.company-information.service.gov.uk/alphabetic-search/companies?q=AHIMSA&size=5"
{}

curl -s -XGET -u my_api_key: "https://api.company-information.service.gov.uk/alphabetic-search/companies?q=AHIMSA%20DAIRY%20FOUNDATION&size=5"
{}

What am I doing wrong?

Hi - I am getting a 404 on the search endpoints as well, such as:

https://api.company-information.service.gov.uk/search/companies?q=ahimsa

Other endpoints are working. I’ve seen lots of queries about 404’s like this but I’ve not seen any answers so if you do get it resolved would be amazing if you could post it here!

We have no reports of issues with that endpoint. I have just tried it and it works for me.

Thanks Mark. I just tried it again and it works. I didn’t change the code at all … weird. All yesterday I was getting a 404 every time I tried a search endpoint.

the original question relates to alphabetic-search. Could you please check if this works for you as well?

curl -s -XGET -u my_api_key: "https://api.company-information.service.gov.uk/alphabetic-search/companies?q=AHIMSA&size=5"

The official documentation incorrectly lists the URL as /alphabetic-search/companies but actually it is /alphabetical-search/companies. Attempting to use the path in the official documentation results in 404 status codes.

Copied from Alphabetical Company Search REST API | CH Guide

1 Like