It is quite surprising that nobody asked for this. The current API endpoints for getting tags and custom fields send only the ID and value. It is not possible to know the name of the custom field or tag. It would be great if names were included in the response.