That's the goal of the semantic web/linked data, and it already works for simple cases. But to take advantage of that you can't be stuck in the popular "REST-but-not-really" custom APIs; you need standard formats and protocols (e.g. RDF/a and SPARQL) that can be queried by software that knows nothing about that particular service.