If you use Kagi Assistant, you can pick one of your lenses (i.e. lists of domains to restrict searches to) in chats. Not sure if their API has that as well or some other way to restrict searches. Also not sure if the Assistant (or API) respects blocked domains when searching.
Yes, the API supports lenses. You can use your account’s Kagi lenses or configure new ones: https://kagi.com/api/docs/openapi/search/search#search/searc...
Same thing with your domain ranks, you can have the API key inherit your account’s existing ranks (blocked, pinned, etc domains) or configure new ones https://kagi.com/api/docs/openapi/search/search#search/searc...
Another reason Kagi is worth paying for.