Fast HTTP client for trading bots — rate-limit bypass via Nexrade relay nodes
Project description
nexrade-req
Fast Python HTTP client for trading bots — bypasses exchange rate limits by routing requests through Nexrade relay nodes.
Part of the Nexrade ecosystem.
How it works
Your bot
│
▼
nexrade-req ──(no api_key)──▶ direct request to exchange
│
└──(with api_key)──▶ Nexrade relay node ──▶ exchange
(rotates IPs, bypasses rate limits)
- Without
api_key: behaves like a normal fast HTTP client - With
api_key: routes through Nexrade's relay network — each request gets a fresh IP, bypassing exchange rate limits
Installation
pip install nexrade-req
Quick start
import nexrade_req as req
# Simple GET (no relay)
r = req.get("https://api.binance.com/api/v3/ticker/price", params={"symbol": "BTCUSDT"})
print(r.status_code, r.json())
# POST
r = req.post("https://httpbin.org/post", json={"key": "value"})
print(r.json())
Using the relay network (bypass rate limits)
from nexrade_req import Client
client = Client(api_key="your_nexrade_api_key")
# All requests are routed through Nexrade relay nodes
r = client.get("https://api.binance.com/api/v3/ticker/price", params={"symbol": "ETHUSDT"})
print(r.json())
Get your API key at nexrade.com.
Session (connection reuse)
from nexrade_req import Client
with Client(api_key="your_key") as c:
r1 = c.get("https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT")
r2 = c.get("https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT")
Custom relay nodes
from nexrade_req import Client
client = Client(
api_key="your_key",
base_urls=["https://your-own-relay.example.com"],
endpoint="api/scraper",
timeout=10,
max_retries=3,
)
Fallback client
FallbackClient retries through the relay, then falls back to a direct request if all relay attempts fail.
from nexrade_req import FallbackClient
r = FallbackClient.get(
"https://api.binance.com/api/v3/ticker/price",
params={"symbol": "BTCUSDT"},
max_retries=3,
)
print(r.json())
API reference
Top-level functions
import nexrade_req as req
req.get(url, **kwargs)
req.post(url, data=None, json=None, **kwargs)
req.put(url, data=None, **kwargs)
req.patch(url, data=None, **kwargs)
req.delete(url, **kwargs)
req.head(url, **kwargs)
req.options(url, **kwargs)
req.request(method, url, **kwargs)
Client constructor
| Parameter | Default | Description |
|---|---|---|
api_key |
None |
Nexrade API key — enables relay routing |
base_urls |
Nexrade nodes | List of relay node URLs |
endpoint |
"api/scraper" |
Relay endpoint path |
max_retries |
1 |
Retry attempts on failure |
timeout |
6 |
Request timeout in seconds |
is_random_base_url |
True |
Rotate relay nodes randomly |
Common request kwargs
| Argument | Description |
|---|---|
params |
Query string dict |
data |
Form body or raw bytes |
json |
JSON body |
headers |
Extra HTTP headers |
timeout |
Override timeout per request |
proxies |
Proxy dict {"https": "http://..."} |
verify |
TLS certificate verification |
Response
| Attribute | Description |
|---|---|
.status_code |
HTTP status code |
.text |
Response body as string |
.content |
Response body as bytes |
.json() |
Parse body as JSON |
.headers |
Response headers |
.url |
Final URL |
.raise_for_status() |
Raise on 4xx/5xx |
Exceptions
from nexrade_req.exceptions import NexradeException
try:
r = client.get("https://api.binance.com/...")
except NexradeException as e:
print("All relay attempts failed:", e)
License
MIT — see LICENSE.
Part of Nexrade
| Product | Description |
|---|---|
| nexrade-req | This library — HTTP client with relay routing |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexrade_req-1.0.0.tar.gz.
File metadata
- Download URL: nexrade_req-1.0.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e3acc88ae4584f2cdfc4fdd6d1789d5ab6c17b1031fd1c6e7d3cf377e61bf5
|
|
| MD5 |
498e9d4ffe956372e06c192c0032cd23
|
|
| BLAKE2b-256 |
3b1743b464c60fb6c83301a580b6f4a9704d6a55700c5508e692aea3ea461a81
|
Provenance
The following attestation bundles were made for nexrade_req-1.0.0.tar.gz:
Publisher:
release.yml on nexrade/nexrade-req
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexrade_req-1.0.0.tar.gz -
Subject digest:
31e3acc88ae4584f2cdfc4fdd6d1789d5ab6c17b1031fd1c6e7d3cf377e61bf5 - Sigstore transparency entry: 1023710032
- Sigstore integration time:
-
Permalink:
nexrade/nexrade-req@3607534a6ec5e933423a1906638ca8e94f10b91d -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/nexrade
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3607534a6ec5e933423a1906638ca8e94f10b91d -
Trigger Event:
push
-
Statement type:
File details
Details for the file nexrade_req-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nexrade_req-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8abf1bb5ce61752f7ec59c50e8a73b7ca323ec1306ecda727d850b22d8f6e14e
|
|
| MD5 |
48c399894f74833e2ac58115a25b4811
|
|
| BLAKE2b-256 |
c803b402b726720ed5e3277f3e71d1d126402d9f637c3f4872b3279c21ae1601
|
Provenance
The following attestation bundles were made for nexrade_req-1.0.0-py3-none-any.whl:
Publisher:
release.yml on nexrade/nexrade-req
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexrade_req-1.0.0-py3-none-any.whl -
Subject digest:
8abf1bb5ce61752f7ec59c50e8a73b7ca323ec1306ecda727d850b22d8f6e14e - Sigstore transparency entry: 1023710093
- Sigstore integration time:
-
Permalink:
nexrade/nexrade-req@3607534a6ec5e933423a1906638ca8e94f10b91d -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/nexrade
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3607534a6ec5e933423a1906638ca8e94f10b91d -
Trigger Event:
push
-
Statement type: