coinxview 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CoinXview
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: coinxview
3
+ Version: 1.0.0
4
+ Summary: Free crypto price API client: prices, market cap, OHLC candles, Fear & Greed and risk scores. No API key, no dependencies.
5
+ Author: CoinXview
6
+ License: MIT
7
+ Project-URL: Homepage, https://coinxview.com/free-crypto-api
8
+ Project-URL: Documentation, https://coinxview.com/free-crypto-api
9
+ Keywords: crypto,cryptocurrency,bitcoin,ethereum,price,api,market cap,ohlc,fear and greed
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Topic :: Office/Business :: Financial
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # coinxview
21
+
22
+ Free crypto price API client for Python. Prices, market cap, OHLC candles, Fear & Greed and risk scores for 1,000+ coins, aggregated from 20+ exchanges.
23
+
24
+ - No API key, no signup
25
+ - Standard library only (no dependencies), Python 3.8+
26
+ - Type hints included
27
+
28
+ Full API docs: **https://coinxview.com/free-crypto-api**
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pip install coinxview
34
+ ```
35
+
36
+ ## Examples
37
+
38
+ ```python
39
+ import coinxview
40
+
41
+ # 1. Prices for a few coins
42
+ for c in coinxview.coins(symbols=["BTC", "ETH", "SOL"])["data"]:
43
+ print(c["symbol"], c["price_usd"])
44
+
45
+ # 2. Top 100 by market cap
46
+ top = coinxview.coins(limit=100)
47
+
48
+ # 3. One coin: markets, supply, 24h high / low
49
+ btc = coinxview.coin("BTC")
50
+
51
+ # 4. Daily candles: [time, open, high, low, close, volume]
52
+ candles = coinxview.ohlc("ETH", interval="1d", limit=30)
53
+
54
+ # 5. Market overview, Fear & Greed, risk score
55
+ overview = coinxview.global_() # "global" is a Python keyword
56
+ fg = coinxview.fear_greed()
57
+ risk = coinxview.risk("DOGE")
58
+ ```
59
+
60
+ Or create a client with your own timeout:
61
+
62
+ ```python
63
+ from coinxview import CoinXview
64
+ cx = CoinXview(timeout=10)
65
+ cx.coins(limit=10)
66
+ ```
67
+
68
+ ## Methods
69
+
70
+ | Method | Endpoint |
71
+ |---|---|
72
+ | `coins(symbols=None, limit=None, start=None)` | `GET /api/v1/coins` |
73
+ | `coin(symbol)` | `GET /api/v1/coins/:symbol` |
74
+ | `global_()` | `GET /api/v1/global` |
75
+ | `fear_greed()` | `GET /api/v1/fear-greed` |
76
+ | `ohlc(symbol, interval="1d", limit=None)` | `GET /api/v1/ohlc/:symbol` — interval `1h`, `4h`, `1d`, `1w` |
77
+ | `risk(symbol)` | `GET /api/v1/risk/:symbol` |
78
+
79
+ Responses are returned as-is (same field names as the API docs).
80
+
81
+ ## Errors and limits
82
+
83
+ Rate limit: **60 requests per minute per IP**. Over the limit, calls raise `CoinXviewError` with `status == 429`. Other HTTP errors raise `CoinXviewError` with the HTTP `status` and the response `body`.
84
+
85
+ ```python
86
+ from coinxview import CoinXviewError
87
+ try:
88
+ coinxview.coin("NOPE")
89
+ except CoinXviewError as e:
90
+ print(e.status)
91
+ ```
92
+
93
+ ## Attribution
94
+
95
+ Data by [CoinXview](https://coinxview.com) — please keep attribution when you show this data.
96
+
97
+ ## License
98
+
99
+ MIT
@@ -0,0 +1,80 @@
1
+ # coinxview
2
+
3
+ Free crypto price API client for Python. Prices, market cap, OHLC candles, Fear & Greed and risk scores for 1,000+ coins, aggregated from 20+ exchanges.
4
+
5
+ - No API key, no signup
6
+ - Standard library only (no dependencies), Python 3.8+
7
+ - Type hints included
8
+
9
+ Full API docs: **https://coinxview.com/free-crypto-api**
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install coinxview
15
+ ```
16
+
17
+ ## Examples
18
+
19
+ ```python
20
+ import coinxview
21
+
22
+ # 1. Prices for a few coins
23
+ for c in coinxview.coins(symbols=["BTC", "ETH", "SOL"])["data"]:
24
+ print(c["symbol"], c["price_usd"])
25
+
26
+ # 2. Top 100 by market cap
27
+ top = coinxview.coins(limit=100)
28
+
29
+ # 3. One coin: markets, supply, 24h high / low
30
+ btc = coinxview.coin("BTC")
31
+
32
+ # 4. Daily candles: [time, open, high, low, close, volume]
33
+ candles = coinxview.ohlc("ETH", interval="1d", limit=30)
34
+
35
+ # 5. Market overview, Fear & Greed, risk score
36
+ overview = coinxview.global_() # "global" is a Python keyword
37
+ fg = coinxview.fear_greed()
38
+ risk = coinxview.risk("DOGE")
39
+ ```
40
+
41
+ Or create a client with your own timeout:
42
+
43
+ ```python
44
+ from coinxview import CoinXview
45
+ cx = CoinXview(timeout=10)
46
+ cx.coins(limit=10)
47
+ ```
48
+
49
+ ## Methods
50
+
51
+ | Method | Endpoint |
52
+ |---|---|
53
+ | `coins(symbols=None, limit=None, start=None)` | `GET /api/v1/coins` |
54
+ | `coin(symbol)` | `GET /api/v1/coins/:symbol` |
55
+ | `global_()` | `GET /api/v1/global` |
56
+ | `fear_greed()` | `GET /api/v1/fear-greed` |
57
+ | `ohlc(symbol, interval="1d", limit=None)` | `GET /api/v1/ohlc/:symbol` — interval `1h`, `4h`, `1d`, `1w` |
58
+ | `risk(symbol)` | `GET /api/v1/risk/:symbol` |
59
+
60
+ Responses are returned as-is (same field names as the API docs).
61
+
62
+ ## Errors and limits
63
+
64
+ Rate limit: **60 requests per minute per IP**. Over the limit, calls raise `CoinXviewError` with `status == 429`. Other HTTP errors raise `CoinXviewError` with the HTTP `status` and the response `body`.
65
+
66
+ ```python
67
+ from coinxview import CoinXviewError
68
+ try:
69
+ coinxview.coin("NOPE")
70
+ except CoinXviewError as e:
71
+ print(e.status)
72
+ ```
73
+
74
+ ## Attribution
75
+
76
+ Data by [CoinXview](https://coinxview.com) — please keep attribution when you show this data.
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,92 @@
1
+ """CoinXview API v1 client — https://coinxview.com/free-crypto-api
2
+
3
+ Standard library only (urllib). Python >= 3.8.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import json
8
+ import urllib.error
9
+ import urllib.parse
10
+ import urllib.request
11
+ from typing import Any, Dict, Iterable, Optional, Union
12
+
13
+ __version__ = "1.0.0"
14
+ __all__ = ["CoinXview", "CoinXviewError", "coins", "coin", "global_", "fear_greed", "ohlc", "risk"]
15
+
16
+ DEFAULT_BASE = "https://coinxview.com/api/v1"
17
+
18
+
19
+ class CoinXviewError(Exception):
20
+ """HTTP or network error. ``status`` is the HTTP status (0 for network errors)."""
21
+
22
+ def __init__(self, message: str, status: int = 0, body: Any = None) -> None:
23
+ super().__init__(message)
24
+ self.status = status
25
+ self.body = body
26
+
27
+
28
+ class CoinXview:
29
+ def __init__(self, base_url: str = DEFAULT_BASE, timeout: float = 15.0) -> None:
30
+ self.base_url = base_url.rstrip("/")
31
+ self.timeout = timeout
32
+
33
+ def _get(self, path: str, query: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
34
+ q = {}
35
+ for k, v in (query or {}).items():
36
+ if v is None or v == "":
37
+ continue
38
+ if isinstance(v, (list, tuple)):
39
+ v = ",".join(str(x) for x in v)
40
+ q[k] = v
41
+ url = self.base_url + path + ("?" + urllib.parse.urlencode(q) if q else "")
42
+ req = urllib.request.Request(url, headers={"Accept": "application/json", "User-Agent": "coinxview-python/" + __version__})
43
+ try:
44
+ with urllib.request.urlopen(req, timeout=self.timeout) as r:
45
+ return json.loads(r.read().decode("utf-8"))
46
+ except urllib.error.HTTPError as e:
47
+ raw = e.read().decode("utf-8", "replace")
48
+ try:
49
+ body: Any = json.loads(raw)
50
+ except ValueError:
51
+ body = raw
52
+ if e.code == 429:
53
+ raise CoinXviewError("coinxview: rate limit 60/min per IP exceeded, retry in a minute", 429, body) from None
54
+ msg = body.get("error") if isinstance(body, dict) else None
55
+ raise CoinXviewError("coinxview: HTTP %d%s" % (e.code, " - " + msg if msg else ""), e.code, body) from None
56
+ except (urllib.error.URLError, TimeoutError, OSError) as e:
57
+ raise CoinXviewError("coinxview: request failed: %s" % e, 0, None) from None
58
+
59
+ def coins(self, symbols: Optional[Union[str, Iterable[str]]] = None, limit: Optional[int] = None, start: Optional[int] = None) -> Dict[str, Any]:
60
+ """Coin list sorted by market cap. ``symbols`` (max 50) or ``limit`` / ``start``."""
61
+ if symbols is not None and not isinstance(symbols, str):
62
+ symbols = list(symbols)
63
+ return self._get("/coins", {"symbols": symbols, "limit": limit, "start": start})
64
+
65
+ def coin(self, symbol: str) -> Dict[str, Any]:
66
+ """One coin with markets, supply and risk breakdown."""
67
+ return self._get("/coins/" + urllib.parse.quote(symbol.upper()))
68
+
69
+ def global_(self) -> Dict[str, Any]:
70
+ """Total market cap, volume, dominance, Fear & Greed. (``global`` is a Python keyword.)"""
71
+ return self._get("/global")
72
+
73
+ def fear_greed(self) -> Dict[str, Any]:
74
+ """Fear & Greed index now + 90 days of history."""
75
+ return self._get("/fear-greed")
76
+
77
+ def ohlc(self, symbol: str, interval: str = "1d", limit: Optional[int] = None) -> Dict[str, Any]:
78
+ """Candles [time, open, high, low, close, volume]. interval: 1h, 4h, 1d, 1w."""
79
+ return self._get("/ohlc/" + urllib.parse.quote(symbol.upper()), {"interval": interval, "limit": limit})
80
+
81
+ def risk(self, symbol: str) -> Dict[str, Any]:
82
+ """CoinXview Risk Score (0-100) with its 5 components."""
83
+ return self._get("/risk/" + urllib.parse.quote(symbol.upper()))
84
+
85
+
86
+ _client = CoinXview()
87
+ coins = _client.coins
88
+ coin = _client.coin
89
+ global_ = _client.global_
90
+ fear_greed = _client.fear_greed
91
+ ohlc = _client.ohlc
92
+ risk = _client.risk
File without changes
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: coinxview
3
+ Version: 1.0.0
4
+ Summary: Free crypto price API client: prices, market cap, OHLC candles, Fear & Greed and risk scores. No API key, no dependencies.
5
+ Author: CoinXview
6
+ License: MIT
7
+ Project-URL: Homepage, https://coinxview.com/free-crypto-api
8
+ Project-URL: Documentation, https://coinxview.com/free-crypto-api
9
+ Keywords: crypto,cryptocurrency,bitcoin,ethereum,price,api,market cap,ohlc,fear and greed
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Topic :: Office/Business :: Financial
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # coinxview
21
+
22
+ Free crypto price API client for Python. Prices, market cap, OHLC candles, Fear & Greed and risk scores for 1,000+ coins, aggregated from 20+ exchanges.
23
+
24
+ - No API key, no signup
25
+ - Standard library only (no dependencies), Python 3.8+
26
+ - Type hints included
27
+
28
+ Full API docs: **https://coinxview.com/free-crypto-api**
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pip install coinxview
34
+ ```
35
+
36
+ ## Examples
37
+
38
+ ```python
39
+ import coinxview
40
+
41
+ # 1. Prices for a few coins
42
+ for c in coinxview.coins(symbols=["BTC", "ETH", "SOL"])["data"]:
43
+ print(c["symbol"], c["price_usd"])
44
+
45
+ # 2. Top 100 by market cap
46
+ top = coinxview.coins(limit=100)
47
+
48
+ # 3. One coin: markets, supply, 24h high / low
49
+ btc = coinxview.coin("BTC")
50
+
51
+ # 4. Daily candles: [time, open, high, low, close, volume]
52
+ candles = coinxview.ohlc("ETH", interval="1d", limit=30)
53
+
54
+ # 5. Market overview, Fear & Greed, risk score
55
+ overview = coinxview.global_() # "global" is a Python keyword
56
+ fg = coinxview.fear_greed()
57
+ risk = coinxview.risk("DOGE")
58
+ ```
59
+
60
+ Or create a client with your own timeout:
61
+
62
+ ```python
63
+ from coinxview import CoinXview
64
+ cx = CoinXview(timeout=10)
65
+ cx.coins(limit=10)
66
+ ```
67
+
68
+ ## Methods
69
+
70
+ | Method | Endpoint |
71
+ |---|---|
72
+ | `coins(symbols=None, limit=None, start=None)` | `GET /api/v1/coins` |
73
+ | `coin(symbol)` | `GET /api/v1/coins/:symbol` |
74
+ | `global_()` | `GET /api/v1/global` |
75
+ | `fear_greed()` | `GET /api/v1/fear-greed` |
76
+ | `ohlc(symbol, interval="1d", limit=None)` | `GET /api/v1/ohlc/:symbol` — interval `1h`, `4h`, `1d`, `1w` |
77
+ | `risk(symbol)` | `GET /api/v1/risk/:symbol` |
78
+
79
+ Responses are returned as-is (same field names as the API docs).
80
+
81
+ ## Errors and limits
82
+
83
+ Rate limit: **60 requests per minute per IP**. Over the limit, calls raise `CoinXviewError` with `status == 429`. Other HTTP errors raise `CoinXviewError` with the HTTP `status` and the response `body`.
84
+
85
+ ```python
86
+ from coinxview import CoinXviewError
87
+ try:
88
+ coinxview.coin("NOPE")
89
+ except CoinXviewError as e:
90
+ print(e.status)
91
+ ```
92
+
93
+ ## Attribution
94
+
95
+ Data by [CoinXview](https://coinxview.com) — please keep attribution when you show this data.
96
+
97
+ ## License
98
+
99
+ MIT
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ coinxview/__init__.py
5
+ coinxview/py.typed
6
+ coinxview.egg-info/PKG-INFO
7
+ coinxview.egg-info/SOURCES.txt
8
+ coinxview.egg-info/dependency_links.txt
9
+ coinxview.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ coinxview
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "coinxview"
7
+ version = "1.0.0"
8
+ description = "Free crypto price API client: prices, market cap, OHLC candles, Fear & Greed and risk scores. No API key, no dependencies."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "CoinXview" }]
13
+ keywords = ["crypto", "cryptocurrency", "bitcoin", "ethereum", "price", "api", "market cap", "ohlc", "fear and greed"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Topic :: Office/Business :: Financial",
19
+ "Typing :: Typed",
20
+ ]
21
+
22
+ [project.urls]
23
+ Homepage = "https://coinxview.com/free-crypto-api"
24
+ Documentation = "https://coinxview.com/free-crypto-api"
25
+
26
+ [tool.setuptools]
27
+ packages = ["coinxview"]
28
+
29
+ [tool.setuptools.package-data]
30
+ coinxview = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+