Forum Discussion

Mekist's avatar
Mekist
Helper III
1 year ago
Solved

Expression.Error: Access to the resource is forbidden.

Hello https://api.fintables.com/analyst-ratings/?brokerage_id=&code=&in_model_portfolio= When accessing the address above over the internet, Power BI gives an error saying "Access to the source is ...
  • v-lgarikapat's avatar
    v-lgarikapat
    1 year ago

    Hi Mekist ,

    Thanks for your prompt response


    API calls are now working as expected, as shown in the screenshots. I am able to fetch the data into Power BI, and it is also working on the web

     

     

    Power BI may be blocked from accessing an API even if it works in a browser due to several reasons. Web servers can return a 403 Forbidden error when they detect requests from non-browser tools like Power BI, often based on missing headers such as User-Agent, Referrer, or Origin. Power BI typically sends minimal headers, which can cause the API to reject the request. Additionally, corporate networks may impose firewall or proxy restrictions that prevent Power BI from reaching certain URLs. Power BI's own privacy settings can also isolate or block web calls if data privacy levels are too strict. Lastly, previously cached or saved credentials may interfere with new API calls unless they are manually cleared.

     

    Mekist  Please follow the troubleshooting steps outlined below and let us know the outcome at your convenience

    To troubleshoot access to the Fintables API in Power BI, first confirm the API is public (which it is, since it loads in your browser). In Power BI, go to File > Options and settings > Data source settings, clear permissions for https://api.fintables.com, and restart Power BI. Next, use Web.Contents in Power Query with a spoofed browser User-Agent header to bypass simple blocks. If you still get Access to the resource is forbidden, go to File > Options > Privacy and set it to Ignore privacy levels. If access is still blocked, try a different network (e.g., home or mobile hotspot) to rule out corporate firewalls. As a reliable workaround, use Python in Power BI: install Python and required packages using pip install panda’s requests, then enable Python scripting in Power BI’s options. When using the Python connector, if you get ModuleNotFoundError, it means you need to install missing packages (like pandas). Finally, if Python is not an option, consider setting up a free API proxy (with Pipedream or Apify) to forward the API request and access the proxy URL in Power BI instead.

     

     

    We truly appreciate your continued engagement and thank you for being an active and valued member of the community.

    If you're still experiencing any challenges, please don’t hesitate to reach out we’d be more than happy to assist you further.

    We look forward to hearing from you.

    Best regards,
    Lakshmi

     

  • Mekist's avatar
    Mekist
    1 year ago
    Hello.
    I've been sick for a few days and haven't been able to reply. Please excuse me.
    
    I tried the options and retrieved the data without the API. I'm not sure if there was a fix on the source side or if the actions were taken.
    
    Thank you for all your support.