$ ping api.cloudflare.com
PING api.cloudflare.com (104.19.192.29) 56(84) bytes of data.
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=1 ttl=54 time=16.3 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=2 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=3 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=4 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=5 ttl=54 time=16.3 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=6 ttl=54 time=16.0 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=7 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=8 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=9 ttl=54 time=16.4 ms
64 bytes from 104.19.192.29 (104.19.192.29): icmp_seq=10 ttl=54 time=16.4 ms
When CURL fails, why do you try to PING?
Please run on the same server the CURL command to api.cloudflare.com otherways this test is useless.
Also as CloudFlare is up and running (checked just right now) this problem must be on your side, not on CloudFlares.