cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Accessing Private API in databricks notebook

Laltu_singh
New Contributor II

Hello, I am trying to access an API in databricks python notebook which is available within a restricted network.

โ€‹

When I try to access that API, it's not able to find the URL used to access the API and throws an HTTP error (max retries exceeded).

โ€‹

do you have any suggestions on how to access the API for above case?

โ€‹

โ€‹

2 REPLIES 2

Anonymous
Not applicable

@Laltu Singhโ€‹ : To access an API in Databricks from within a restricted network, you may need to configure a proxy server to route your requests through like below.

import os
 
os.environ['HTTP_PROXY'] = 'http://<proxy_hostname>:<proxy_port>'
os.environ['HTTPS_PROXY'] = 'http://<proxy_hostname>:<proxy_port>'
os.environ['NO_PROXY'] = '<comma-separated-list-of-hostnames-or-IP-addresses>'

Replace <proxy_hostname> and <proxy_port> with the hostname and port of your proxy server, respectively. Replace <comma-separated-list-of-hostnames-or-IP-addresses> with a comma-separated list of hostnames or IP addresses that should not be routed through the proxy.

If you continue to experience issues accessing the API, it may be helpful to reach out to the network administrator for the restricted network to ensure that the necessary firewall rules are in place to allow traffic to and from the API endpoint.

Anonymous
Not applicable

Hi @Laltu Singhโ€‹ 

Hope everything is going great.

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you. 

Cheers!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.