Skip to content

Commit

Permalink
Update Binance API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
morteza-koohgard committed Oct 9, 2024
1 parent b1b4bb7 commit 0dfd07c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_starting_time(self, symbol: str) -> int:
'limit': 1500,
}

response = requests.get(self.endpoint + '/v1/klines', params=payload)
response = requests.get(self.endpoint + '/v3/klines', params=payload)

self.validate_response(response)

Expand All @@ -54,7 +54,7 @@ def fetch(self, symbol: str, start_timestamp: int, timeframe: str = '1m') -> Uni
'limit': self.count,
}

response = requests.get(self.endpoint + '/v1/klines', params=payload)
response = requests.get(self.endpoint + '/v3/klines', params=payload)

self.validate_response(response)

Expand All @@ -73,7 +73,7 @@ def fetch(self, symbol: str, start_timestamp: int, timeframe: str = '1m') -> Uni
} for d in data]

def get_available_symbols(self) -> list:
response = requests.get(self.endpoint + '/v1/exchangeInfo')
response = requests.get(self.endpoint + '/v3/exchangeInfo')

self.validate_response(response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class BinanceSpot(BinanceMain):
def __init__(self) -> None:
super().__init__(
name=exchanges.BINANCE_SPOT,
rest_endpoint='https://www.binance.com/api',
rest_endpoint='https://api.binance.com/api',
backup_exchange_class=None
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def __init__(self) -> None:

super().__init__(
name=exchanges.BINANCE_US_SPOT,
rest_endpoint='https://www.binance.us/api',
rest_endpoint='https://api.binance.us/api',
backup_exchange_class=BinanceSpot
)

0 comments on commit 0dfd07c

Please sign in to comment.