[Development Guides Home](/guides) >> [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system) >> [LiveAPI Methods](/guides/guide-to-the-liveapi-system/guide-to-the-liveapi-system-liveapi-methods) # Guide to the LiveAPI System - The fetch() Method The `fetch()` method is a wrapper to return a hash reference from the `cpanelprint()` function, which retrieves a cPanel variable. * We **deprecated** this method. * To return a data result for a cPanel variable's value, use the [`cpanelprint()`](/guides/guide-to-the-liveapi-system/guide-to-the-liveapi-system-liveapi-methods/guide-to-the-liveapi-system-the-cpanelprint-method) method. ## Example ### LiveAPI PHP Class ```php // Get a hashref of the cPanel account's username. $cpanel->fetch('$user'); ``` ### LiveAPI Perl Module ```perl # Get a hashref of the cPanel account's username. $cpliveapi->fetch('$user'); ``` ## Parameters | Parameter | Type | Description | Possible values | Example | | --- | --- | --- | --- | --- | | `variable` | *string* | A cPanel variable. | A valid cPanel variable. For a full list of cPanel variables, read our [Guide to cPanel Variables](/guides/guide-to-cpanel-variables) documentation. | `$user` | ## Returns This method returns the cPanel variable's value as a hash reference.