I’m Having Difficulty Connecting to Birdeye.so Crypto API

I’ve been trying (unsuccessfully) on connecting to the birdeye.so API to my DNN (coded in Python). I have the standard plan and I’ve been using the updated APIs since their move away from public APIs (ie i’m now using https://public-api.birdeye.so/defi/price and https://public-api.birdeye.so/defi/history_price etc rather than their previous public api https://public-api.birdeye.so/public/history_price) as well as my API key, and it is not working. I’ve tried changing my dns to the google dns etc on my browser and it doesn’t fix the problem. After trying many things, I’m thinking it may be on their end, but I am not completely sure. Below I will include the error message and, below that, the code for implementation of the API so you can see it it correct. I have replaced my actual API Key with a redacted note for example purposes obviously. Any help would be so GREATLY appreciated, as I’ve been spinning my wheels for hours and wondering if it’s an issue on their end or my end. Thank you for your help.

This is the error message that is showing up:

--------------------------------------------------------------------------
   `gaierror                                  Traceback (most recent call last)
    File ~anaconda3Libsite-packagesurllib3connection.py:174, in HTTPConnection._new_conn(self)
    173 try:
    --> 174     conn = connection.create_connection(
    175         (self._dns_host, self.port), self.timeout, **extra_kw
    176     )
    178 except SocketTimeout:

File ~anaconda3Libsite-packagesurllib3utilconnection.py:72, in create_connection(address, timeout, source_address, socket_options)
     68     return six.raise_from(
     69         LocationParseError(u"'%s', label empty or too long" % host), None
     70     )
---> 72 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     73     af, socktype, proto, canonname, sa = res

File ~anaconda3Libsocket.py:962, in getaddrinfo(host, port, family, type, proto, flags)
    961 addrlist = []
--> 962 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    963     af, socktype, proto, canonname, sa = res

gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
File ~anaconda3Libsite-packagesurllib3connectionpool.py:714, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    713 # Make the request on the httplib connection object.
--> 714 httplib_response = self._make_request(
    715     conn,
    716     method,
    717     url,
    718     timeout=timeout_obj,
    719     body=body,
    720     headers=headers,
    721     chunked=chunked,
    722 )
    724 # If we're going to release the connection in ``finally:``, then
    725 # the response doesn't need to know about the connection. Otherwise
    726 # it will also try to release it and we'll have a double-release
    727 # mess.

File ~anaconda3Libsite-packagesurllib3connectionpool.py:403, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    402 try:
--> 403     self._validate_conn(conn)
    404 except (SocketTimeout, BaseSSLError) as e:
    405     # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.

File ~anaconda3Libsite-packagesurllib3connectionpool.py:1053, in HTTPSConnectionPool._validate_conn(self, conn)
   1052 if not getattr(conn, "sock", None):  # AppEngine might not have  `.sock`
-> 1053     conn.connect()
   1055 if not conn.is_verified:

File ~anaconda3Libsite-packagesurllib3connection.py:363, in HTTPSConnection.connect(self)
    361 def connect(self):
    362     # Add certificate verification
--> 363     self.sock = conn = self._new_conn()
    364     hostname = self.host

File ~anaconda3Libsite-packagesurllib3connection.py:186, in HTTPConnection._new_conn(self)
    185 except SocketError as e:
--> 186     raise NewConnectionError(
    187         self, "Failed to establish a new connection: %s" % e
    188     )
    190 return conn

NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000002003B400B50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
File ~AppDataRoamingPythonPython311site-packagesrequestsadapters.py:486, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    485 try:
--> 486     resp = conn.urlopen(
    487         method=request.method,
    488         url=url,
    489         body=request.body,
    490         headers=request.headers,
    491         redirect=False,
    492         assert_same_host=False,
    493         preload_content=False,
    494         decode_content=False,
    495         retries=self.max_retries,
    496         timeout=timeout,
    497         chunked=chunked,
    498     )
    500 except (ProtocolError, OSError) as err:

File ~anaconda3Libsite-packagesurllib3connectionpool.py:798, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    796     e = ProtocolError("Connection aborted.", e)
--> 798 retries = retries.increment(
    799     method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    800 )
    801 retries.sleep()

File ~anaconda3Libsite-packagesurllib3utilretry.py:592, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
    591 if new_retry.is_exhausted():
--> 592     raise MaxRetryError(_pool, url, error or ResponseError(cause))
    594 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)

MaxRetryError: HTTPSConnectionPool(host='api.birdseye.so', port=443): Max retries exceeded with url: /defi/history_price?symbol=SOL-USD (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002003B400B50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
Cell In[4], line 88
     85         print("No data to process.")
     87 if __name__ == '__main__':
---> 88     main('SOL-USD')  # Update the pair symbol as needed

Cell In[4], line 60, in main(pair_symbol)
     59 def main(pair_symbol):
---> 60     df = fetch_coin_history(pair_symbol)
     61     if df is not None:
     62         sequences, next_prices, scaler = preprocess_data(df)

Cell In[4], line 16, in fetch_coin_history(pair_symbol, retry_attempts, delay_seconds)
     14 headers = {'Authorization': 'Bearer MyRedactedAPIKey'}
     15 for attempt in range(retry_attempts):
---> 16     response = requests.get(base_url, headers=headers)
     17     if response.status_code == 200:
     18         print("Data fetched successfully.")

File ~AppDataRoamingPythonPython311site-packagesrequestsapi.py:73, in get(url, params, **kwargs)
     62 def get(url, params=None, **kwargs):
     63     r"""Sends a GET request.
     64 
     65     :param url: URL for the new :class:`Request` object.
   (...)
     70     :rtype: requests.Response
     71     """
---> 73     return request("get", url, params=params, **kwargs)

File ~AppDataRoamingPythonPython311site-packagesrequestsapi.py:59, in request(method, url, **kwargs)
     55 # By using the 'with' statement we are sure the session is closed, thus we
     56 # avoid leaving sockets open which can trigger a ResourceWarning in some
     57 # cases, and look like a memory leak in others.
     58 with sessions.Session() as session:
---> 59     return session.request(method=method, url=url, **kwargs)

File ~AppDataRoamingPythonPython311site-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    584 send_kwargs = {
    585     "timeout": timeout,
    586     "allow_redirects": allow_redirects,
    587 }
    588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
    591 return resp

File ~AppDataRoamingPythonPython311site-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs)
    700 start = preferred_clock()
    702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
    705 # Total elapsed time of the request (approximately)
    706 elapsed = preferred_clock() - start

File ~AppDataRoamingPythonPython311site-packagesrequestsadapters.py:519, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    515     if isinstance(e.reason, _SSLError):
    516         # This branch is for urllib3 v1.22 and later.
    517         raise SSLError(e, request=request)
--> 519     raise ConnectionError(e, request=request)
    521 except ClosedPoolError as e:
    522     raise ConnectionError(e, request=request)

ConnectionError: HTTPSConnectionPool(host='api.birdseye.so', port=443): Max retries exceeded with url: /defi/history_price?symbol=SOL-USD (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002003B400B50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))`
And this is the way I have the API connected in my code:
def fetch_coin_history(pair_symbol, retry_attempts=5, delay_seconds=10):
    """Fetch historical price data for a given trading pair symbol using Birdseye Crypto API."""
    base_url = f"https://api.birdseye.so/defi/history_price?symbol={pair_symbol}"
    headers = {'Authorization': 'Bearer MyRedactedAPI KEY'}
    for attempt in range(retry_attempts):
        response = requests.get(base_url, headers=headers)
        if response.status_code == 200:
            print("Data fetched successfully.")
            data = response.json()
            if 'data' in data and data['data']:  # Ensure the key 'data' contains useful   
    information
                return pd.DataFrame(data['data'])
            else:
                print("Price history is missing or empty.")
                return None
        else:
            print(f"Attempt {attempt+1} of {retry_attempts}: Failed to fetch data: HTTP  
    {response.status_code}, Details: {response.text}")
            time.sleep(delay_seconds)  # Wait before retrying
    return None`

I’ve been using the updated APIs since their move away from public APIs (ie i’m now using https://public-api.birdeye.so/defi/price and https://public-api.birdeye.so/defi/history_price etc rather than their previous public api https://public-api.birdeye.so/public/history_price) as well as my API key, and it is not working. I’ve tried changing my dns to the google dns etc on my browser and it doesn’t fix the problem. After trying many things, I’m thinking it may be on their end, but I am not completely sure. Any help would be appreciated.

New contributor

Viper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật