Unfortunately, Google has sunset the Related Queries API. There are similar and semi-similar APIs though.
I am not affiliated with any of these, and haven't used any of them.
Similarweb provides an API to find domains that are similar to passed domains. It's not the same as search terms, but if you know which domains you wish to compare, that is an option. It is not a free service though.
Another pay service is from KeywordDiscovery and their related keywords.
Yahoo! provides a related search service. It is not free, and will return 10 results per query. This is part of their BOSS search product.