What is the difference between XRP API and ripple-lib?

XRP API is a REST-like API server for the XRP Ledger. You can run an XRP API server for your application to query for ledger data, prepare transactions, and sign transactions. As a standalone server package with an HTTP REST API, it is programming language agnostic.

ripple-lib is a TypeScript/JavaScript client library for the XRP Ledger. It offers full access to the XRP Ledger including features like the decentralized exchange (DEX), advanced transaction types like Escrows and Payment Channels, and advanced security features like Multi-Sign.