1

I have data in a database within Metabase than I am looking to extract through their API.

https://www.metabase.com/learn/administration/metabase-api

As suggested I am using the code below to access it:

import requests
import pandas as pd

response = requests.post('http://localhost:3000/api/session',
                         json={'username': '*********',
                               'password': '*******'})
session_id = response.json()['id']
headers = {'X-Metabase-Session': session_id}

However, I cannot get through the localhost getting the error

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

and

HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002310642FE80>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

How do I resolve this?

ben121
  • 879
  • 1
  • 11
  • 23
  • Does this solves your problem? [Python requests return 504 in localhost](https://stackoverflow.com/questions/43254103/python-requests-return-504-in-localhost) – imxitiz Aug 05 '21 at 09:36
  • Please follow up https://stackoverflow.com/questions/12993276/errno-10061-no-connection-could-be-made-because-the-target-machine-actively-re – Rinshan Kolayil Aug 05 '21 at 09:39

0 Answers0