Skip to content

Fatal error: Uncaught Finnhub\ApiException: [0] cURL error 6: Could not resolve host: finnhub.io #1

@OnceWasPerfect

Description

@OnceWasPerfect

Hello,

I use your api to pull a stock quote every few seconds. I had it all working yesterday and this morning I loaded up my test site and got the error in the title. The code i'm using is this:

   require_once('../vendor/autoload.php');
    require('functions.php');
    
    $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKey('token', 'my api key');
    $client = new Finnhub\Api\DefaultApi(new GuzzleHttp\Client(), $config);
        
    
    $q = $_REQUEST['q'];

    echo formatUSD($client->quote($q)->getc());

The formatUSD is just a little function I made to display it as money. I did also try without that function just to make sure it wasn't causing an error somehow.

The rest of the error references lines 9698 and 9674 in DefaultApi.php.

Thank you!

Edit: removed my api key but it is there in my code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions