How to fetch data from API in PHP using cURL code example Example: how to read data from curl php $data = json_decode(file_get_contents('php://input'), true);