hi
ref this link
https://www.codeaman.com/2020/05/what-is-api-what-is-web-service-difference-between-api-and-webservice.html
Summary
1. All Web services are APIs but all APIs are not Web services.
2. Web services might not perform all the operations that an API would perform.
3. A Web service uses only three styles of use: SOAP, REST, and XML-RPC for communication whereas API may use any style for communication.
4. A Web service always needs a network for its operation whereas an API doesn’t need a network for its operation
which is correct