Decentralized applications require a connection to blockchain nodes to access and interact with the underlying blockchain data. API facilitates this connection by providing developers with a set of endpoints and functionalities that allow their applications to communicate with the nodes.