cURL Helper
WTF provides you with a simple way to use cURL to retrieve data from API’s. This function is used by some of the other methods in the WTF that get data from 3rd party API’s (i.e. tinyURL, Feedburner Count, Latest Tweet). To use the cURL helper function add the following code anywhere in you site:
<?php if(function_exists('wtf_api_call')) $response = wtf_api_call('http://test-api.com/get_data'); ?>
Note in the above example I am passing in an example API URL string. This function will either return the data from the API or false if there is an error.
Advanced
This method takes one argument:
wtf_api_call($url);
- $url
- Description – The URL of a third party API.

