المطورون

بوابة المطوّرين

كل نقطة نهاية عامة، بمعاملاتها وحقول استجابتها ومثال على الاستجابة وطلب قابل للتنفيذ بأربع لغات.

  • OpenAPI 1.3.0
  • 15 نقطة نهاية موثّقة
المحتويات

نظرة عامة على الواجهة

من مستند OpenAPI
Market data, AI-enriched news, and the verification record behind every published accuracy figure.

Two things are worth reading before integrating. Market data carries the timestamp of the reading itself, so judge freshness from that and not from when you asked. And accuracy over models (`rolling_accuracy` in /api/metrics/) is a separate figure from accuracy over every scored prediction, which includes the deterministic rule-based engine.

API keys, scopes and hourly budgets are not enforced at the moment: every public route answers without a key.

كل استجابة هي JSON عبر HTTPS. والطلبات من نوع GET ما لم يُذكر خلاف ذلك، ولا تتطلب أي نقطة نهاية جسم طلب. حلّل الاستجابة بتسامح: تُضاف حقول جديدة دون إشعار، والعميل الذي يرفض المفاتيح غير المعروفة سينكسر بسبب إضافة لا تكسر أحدًا غيره.

الأخطاء

الفشل هو حالة HTTP مع جسم JSON يسمّي السبب. والجسم دائمًا كائن يحمل المفتاح error؛ وحيثما تستطيع المنصة أن تقول ما العمل، يحمل الكائن ذلك أيضًا.

الحالة الجسم المعنى
400{"error": "query_too_short"} فُهم الطلب ورُفض. والنتيجة الفارغة تُعاد كقائمة فارغة، لا كخطأ 400 — لذا فإن 400 تعني دائمًا أن الطلب نفسه كان خاطئًا.
403{"error": "forbidden"} هذا المسار مخصّص لفريق العمل فقط.
404{"error": "No accuracy data found"} لا يوجد شيء مخزّن لما يسمّيه المسار.
429{"error": "Rate limit exceeded"} يحدّ هذا المسار عدد الطلبات في الدقيقة، وقد بلغ عنوان IP الخاص بك الحد. انتظر عدد الثواني المذكور في Retry-After.
503{"error": "…"} الخدمة أو أحد ما تعتمد عليه غير متاح. وتبقى البيانات المخزّنة متاحة حيث وُجدت.

حداثة البيانات

حداثة البيانات مُصرَّح بها لا مُستنتجة. ولا يصف أي حمل بيانات نفسه بأنه حالي استنادًا إلى وقت طلبك له: تُقاس القراءة بطابعها الزمني الخاص مقابل الفترة التي يفترض أن تلتزم بها تغذيتها. وحين تحمل مجموعة بيانات حالة صحية، فهي واحدة من هذه التسع ولا شيء غيرها.

  • live — مباشر
  • delayed — متأخر
  • refreshing — قيد التحديث
  • stale — قديم
  • partial — جزئي
  • historical — تاريخي
  • unavailable — غير متاح
  • error — خطأ
  • offline — غير متصل

يعتمد الحقل الحامل لها على نقطة النهاية، وجدول الاستجابة لكل نقطة نهاية أدناه يذكر ذلك بدقة. باختصار: /api/global-markets/ تحمل last_updated وكائن data_status بعدّادات التغطية وdata_sources؛ و/api/market-data/ تحمل timestamp على كل شمعة؛ و/api/news/ تحمل published_at على كل مقالة. والقراءة التي يغيب طابعها الزمني لا تُعرض أبدًا على أنها حيّة — بل تُعرض على أنها unavailable، لأن قيمة بلا وقت لا يمكن إثبات أنها حالية.

حدود المعدل وترويساتها

لا تُطبَّق حاليًا حصة في الساعة أو اليوم، بمفتاح أو دونه، ولا تحمل الاستجابات ترويسات X-RateLimit-. تحدّ بعض المسارات عدد الطلبات في الدقيقة لكل عنوان IP، والطلب الزائد يُردّ عليه بالرمز 429 مع Retry-After بالثواني.

المصادقة

لا تحتاج المسارات العامة إلى مفتاح. يمكنك إنشاء مفاتيح في حسابك، لكن الواجهة البرمجية لا تتحقق منها حاليًا: يُجاب الطلب بالطريقة نفسها بمفتاح أو دون مفتاح أو بمفتاح خاطئ. والمفتاح المُرسل اليوم يوضع في ترويسة X-API-Key ولا يغيّر شيئًا.

  • am_live_… يبدأ كل مفتاح بهذه البادئة الثابتة، فتُعرَف السلسلة المسرَّبة في سجل أو لصق من نظرة واحدة، وتستطيع ماسحات الأسرار الاعتماد عليها.
  • يُعرض مرة واحدة تخزّن قاعدة البيانات بصمة SHA-256 وأول اثني عشر حرفًا فقط، لا المفتاح نفسه. والمفتاح المفقود يُستبدل ولا يُسترجع — إذ لا يوجد ما يُسترجع منه.
  • التدوير والإلغاء يُصدر التدوير مفتاحًا بديلًا ويعلّم السابق ملغيًا في خطوة واحدة. ويُحفظ سجلّه لتبقى سلسلة التدوير قابلة للقراءة.

النطاقات

يُخزَّن المفتاح مع نطاقات. ولا يُتحقق منها حاليًا، فلا يردّ أي مسار بالرمز 403 لغياب نطاق.

النطاقالاسمالمسارات
market_dataMarket data/api/market-data/, /api/global-markets/, /api/heatmap/
newsNews/api/news/
accuracyAccuracy & analysis/api/accuracy/*, /api/analysis/
feedsRSS / Atom feeds/rss/*, /atom/*

أنشئ المفاتيح ودوّرها وألغِها من حسابك ←

نقاط نهاية الجلسة ليست جزءًا من هذه الواجهة

المسارات أدناه موجودة وليست في الوثيقة أعلاه. ولا يفتح أيًّا منها مفتاح واجهة برمجية: معظمها يعمل على سجلات شخص واحد مسجّل الدخول، والأخيران إشارات يرسلها الموقع إلى نفسه. وقد أُدرجت ليكون الحد واضحًا.

المسارما تفعله
/api/watchlist/قائمة متابعة القارئ المسجَّل؛ إضافة وإزالة.
/api/alerts/التنبيهات التي يملكها على أصل؛ إنشاء وحذف.
/api/saved-stories/المقالات التي حفظها، ومفتاح الحفظ لمقالة واحدة.
/api/saved-filters/العروض التي حفظها، والصفحات التي يمكن الحفظ منها، والحذف.
/api/preferences/تفضيلات اللغة والمظهر والكثافة.
/api/telemetry/rum/إشارة متصفح داخلية: LCP وINP وCLS وTTFB. ليست عقدًا عامًا.
/api/telemetry/event/إشارة أحداث منتج داخلية، مقصورة على ثوابت مُسمّاة.

بيانات السوق

الأسعار واتساع السوق والبحث. اقرأ حقل الحداثة المذكور في جدول استجابة كل نقطة نهاية قبل اعتبار أي قيمة حالية.

GET /api/global-markets/

Index and regional market summary

The crypto market totals, then the stocks, indices and commodities of the latest stored fetch, each with its price, change and the timestamp of that reading. It is not a list of every symbol the platform stores, and an index level that is not plausible is left out.

مخطط الاستجابة

6 /api/global-markets/
الحقل النوع الوصف
last_updated string (ISO 8601) When this snapshot was assembled. Compare it against the per-row timestamp values before calling anything current.
data_status object Availability counters for the snapshot: which sub-datasets were present and how many rows each carried. It reports coverage, not age — age comes from the timestamps.
data_sources object Which upstream provided each block. For stocks it is read off the rows, and says "not recorded" where they name none.
rate_limit_status object Deprecated. Not measured: every value is null. Removal on or after 2027-02-23.
crypto object Total market cap, 24h volume, dominance and the Fear & Greed reading, each with its own timestamp.
stocks[] / indices[] / commodities[] array The instruments of the latest stored fetch: symbol, name, price, change_percent and the timestamp of that reading.

مثال على الاستجابة

JSON /api/global-markets/
JSON
{
  "crypto": {
    "market_cap": {
      "value": 2729426102416.08,
      "delta": null,
      "timestamp": "2026-08-27T17:25:37.737074+00:00"
    },
    "fear_greed": {
      "value": 71.0,
      "classification": "Greed",
      "timestamp": "2026-08-27T00:00:00+00:00"
    }
  },
  "indices": [
    {
      "symbol": "SP500",
      "name": "S&P 500",
      "price": 5431.2,
      "change_percent": 0.81,
      "timestamp": "2026-09-01T06:56:18.218215+00:00"
    }
  ],
  "last_updated": "2026-09-01T23:22:14.321930+00:00",
  "data_status": {
    "crypto_available": true,
    "stocks_count": 10,
    "indices_count": 7,
    "commodities_count": 8
  },
  "data_sources": {
    "crypto": "CoinGecko",
    "indices": "Yahoo Finance"
  },
  "rate_limit_status": {
    "crypto_rate_limited": null,
    "fallback_used": null,
    "cache_age_minutes": null
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/global-markets/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/global-markets/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/global-markets/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/global-markets/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/global-markets/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/heatmap/

Market breadth as a heatmap dataset

Symbols of one category with their change and a size weight, shaped for a treemap. A category is returned whole, not in pages.

الترقيم والترتيب: None, deliberately: a treemap of half a market is a different picture, not a first page. Expect the whole category in one response and size your client for it.

المعاملات

الاسم الموقع النوع مطلوب الوصف
category query string لا crypto (default), etf, sectors, sp500, dow30, nasdaq100, russell2000, allstocks, world or futures.

مخطط الاستجابة

10 /api/heatmap/
الحقل النوع الوصف
items[].label string Ticker, as displayed in the tile.
items[].name string Full instrument name.
items[].size number Area weight: market capitalisation, or trading activity where none is known.
items[].change number Percent change driving the tile colour.
items[].price number Latest stored price.
items[].sector / industry string Grouping for the treemap.
items[].type string crypto, or the instrument type the quote source gives, such as equity.
items[].data_health string Health state of that item.
data_health object State of the whole set, with counts of items, of items that carry a change, and of synthetic items.
fallback boolean Present and true when a built-in sample is served in place of market data. Its items are marked unavailable and synthetic.

مثال على الاستجابة

JSON /api/heatmap/
JSON
{
  "items": [
    {
      "label": "BTC",
      "name": "Bitcoin",
      "size": 1551334515862.0,
      "change": -1.60013,
      "price": 77271.0,
      "volume": 29846188636.0,
      "sector": "Mega Cap (Top 10)",
      "industry": "Digital Asset",
      "type": "crypto",
      "data_health": "live"
    }
  ],
  "cached": false,
  "data_health": {
    "status": "live",
    "items_total": 100,
    "items_with_change": 100,
    "items_synthetic": 0
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/heatmap/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/heatmap/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/heatmap/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/heatmap/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/heatmap/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/market-data/

Stored price series for crypto and stocks

Stored prices per symbol, oldest first, each with the timestamp of the price itself rather than of the request. This payload carries no data_status field: judge freshness from the last timestamp, and treat an old one as stale.

المعاملات

الاسم الموقع النوع مطلوب الوصف
symbols query string لا Comma-separated symbols, e.g. BTC,AAPL. Defaults to BTC,ETH,TSLA,AAPL when omitted.

مخطط الاستجابة

6 /api/market-data/
الحقل النوع الوصف
crypto.charts.<SYMBOL>[] array OHLCV candles, oldest first.
crypto.charts.<SYMBOL>[].timestamp string (ISO 8601) The candle's own time, not the time of your request. This is the value freshness is judged from.
crypto.charts.<SYMBOL>[].open/high/low/close number Prices in USD.
crypto.charts.<SYMBOL>[].volume number Volume as the source of that candle reported it. The unit is not the same throughout the series: some candles carry US dollars and some carry the number of coins. Do not sum or compare them.
crypto.analyses.<SYMBOL> string One-line summary of the symbol. When there is none it is "<SYMBOL>: No data", "<SYMBOL>: Market not found" or "<SYMBOL>: Analysis unavailable".
stocks object Same two keys, for equities and for symbols with no stored data. Each row can be a single stored quote (open, high, low and close equal). volume is what the quote source reported for the session, and 0 when it reported none.

مثال على الاستجابة

JSON /api/market-data/
JSON
{
  "crypto": {
    "charts": {
      "BTC": [
        {
          "timestamp": "2026-09-01T00:00:00Z",
          "open": 76980.0,
          "high": 77650.0,
          "low": 76410.0,
          "close": 77140.0,
          "volume": 22140.0
        }
      ]
    },
    "analyses": {
      "BTC": "BTC: Bullish trend"
    }
  },
  "stocks": {
    "charts": {
      "AAPL": []
    },
    "analyses": {}
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/market-data/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/market-data/?symbols=BTC%2CAAPL"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/market-data/",
    params={"symbols": "BTC,AAPL"},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/market-data/");
url.search = new URLSearchParams({ symbols: "BTC,AAPL" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["symbols" => "BTC,AAPL"]);
$url = "https://www.analystmarkets.com/api/market-data/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/search/palette/

Command-palette search across assets, news and pages

Grouped results for one query: matching assets, recent articles naming them, and the platform pages that answer the question. Every item carries the URL it resolves to, so a client can act on a result without a second call. Queries shorter than the minimum return 400 with error: query_too_short rather than an empty list, because an empty list reads as "nothing matches".

المعاملات

الاسم الموقع النوع مطلوب الوصف
q query string لا The query. Below the minimum length the endpoint returns 400.

مخطط الاستجابة

9 /api/search/palette/
الحقل النوع الوصف
query string The query, echoed back.
total integer Result count across every group.
groups[].id string assets, news, reports, models, topics or actions.
groups[].label string Localised group heading.
groups[].items[].title string What to display.
groups[].items[].subtitle string Instrument name, or the publisher for an article.
groups[].items[].url string Where the result resolves to.
groups[].items[].actions[] array Follow-on destinations for an asset — dossier, news, accuracy, compare, backtest — so a client need not construct them.
error string Present only on 400: query_too_short.

مثال على الاستجابة

JSON /api/search/palette/
JSON
{
  "query": "bitcoin",
  "total": 6,
  "groups": [
    {
      "id": "assets",
      "label": "Assets",
      "items": [
        {
          "kind": "asset",
          "symbol": "BTC",
          "title": "BTC",
          "subtitle": "Bitcoin",
          "url": "/symbol/BTC/",
          "actions": [
            {
              "title": "Open asset dossier",
              "url": "/symbol/BTC/"
            }
          ]
        }
      ],
      "more_url": ""
    }
  ]
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/search/palette/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/search/palette/?q=bitcoin"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/search/palette/",
    params={"q": "bitcoin"},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/search/palette/");
url.search = new URLSearchParams({ q: "bitcoin" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["q" => "bitcoin"]);
$url = "https://www.analystmarkets.com/api/search/palette/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/symbols/autocomplete/

Symbol search

Symbols matching a partial name or ticker, for an autocomplete control. Symbols are returned as the platform stores them.

المعاملات

الاسم الموقع النوع مطلوب الوصف
q query string لا Partial symbol or name.

مخطط الاستجابة

1 /api/symbols/autocomplete/
الحقل النوع الوصف
symbols[] array of string Up to fifteen tickers beginning with the query, crypto first, then equities, spelled as they are stored.

مثال على الاستجابة

JSON /api/symbols/autocomplete/
JSON
{
  "symbols": [
    "BTC",
    "BTCB"
  ]
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/symbols/autocomplete/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/symbols/autocomplete/?q=bt"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/symbols/autocomplete/",
    params={"q": "bt"},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/symbols/autocomplete/");
url.search = new URLSearchParams({ q: "bt" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["q" => "bt"]);
$url = "https://www.analystmarkets.com/api/symbols/autocomplete/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);

الأخبار

مقالات مع إثرائها بالذكاء الاصطناعي. في المقال الذي لم يُحلَّل يكون ai_sentiment فارغًا، وهذا لا يعني محايدًا.

GET /api/news/

Recent news articles with AI enrichment

Articles newest first, each with its source and, when a model has read it, its AI sentiment, summary and confidence. ai_sentiment is empty on articles that have not been analysed, so a missing reading is distinguishable from a neutral one. The view value high-impact keeps only recent articles whose confidence is 70 or more, and orders them by confidence instead of time.

الترقيم والترتيب: No cursor. limit caps the page and articles come back newest first; poll with the newest published_at you already hold as your watermark.

المعاملات

الاسم الموقع النوع مطلوب الوصف
limit query integer لا Articles to return, 1 to 100. Default 10.
symbol query string لا Only articles naming this symbol.
view query string لا One of the news page tabs: brief, latest, high-impact, macro, equities, crypto, commodities.
category query string لا One article category, e.g. crypto or stocks.
source query string لا Publisher name.
search query string لا Free-text search.
trusted query string لا 1 for first-tier publishers only.

مخطط الاستجابة

13 /api/news/
الحقل النوع الوصف
articles[].id integer Stable article id. Use it against /api/accuracy/article/{id}/.
articles[].title string Headline as published.
articles[].summary string The publisher's summary, empty when there is none.
articles[].url string The publisher's URL, not ours.
articles[].source string Publisher name.
articles[].category string crypto, stocks, commodities, economy, technology, regulation, ai, global_markets, mena, financial or general.
articles[].published_at string (ISO 8601) Publication time, UTC. This is the freshness signal for news: there is no separate status field on this endpoint.
articles[].image_url string Image address, or "".
articles[].ai_sentiment string The reading, or "" when the article has not been analysed. Normally bullish, bearish or neutral; some older articles carry other wording, so treat anything else as no direction.
articles[].ai_summary string Summary written by the engine that read the article.
articles[].ai_confidence number The engine's own confidence, 0 to 100. Present on articles that have not been analysed too, so use ai_sentiment to tell whether there is a reading.
articles[].sentiment string Kept for compatibility and neutral on every article. Read ai_sentiment instead.
filters object The filters as applied.

مثال على الاستجابة

JSON /api/news/
JSON
{
  "articles": [
    {
      "id": 41,
      "title": "Nvidia beats on data-centre revenue as AI demand holds",
      "summary": "Data-centre revenue came in above estimates.",
      "url": "https://example.com/wire/nvidia-q3",
      "source": "Reuters",
      "category": "stocks",
      "published_at": "2026-09-01T06:40:18+00:00",
      "image_url": "",
      "sentiment": "neutral",
      "ai_sentiment": "bullish",
      "ai_summary": "Nvidia reported higher data-centre revenue.",
      "ai_confidence": 70.0
    }
  ],
  "filters": {
    "view": "brief",
    "category": "",
    "source": "",
    "search": "",
    "symbol": "NVDA",
    "trusted": false
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/news/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/news/?limit=2&symbol=NVDA"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/news/",
    params={"limit": 2, "symbol": "NVDA"},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/news/");
url.search = new URLSearchParams({ limit: "2", symbol: "NVDA" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["limit" => 2, "symbol" => "NVDA"]);
$url = "https://www.analystmarkets.com/api/news/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);

الدقة

سجل التحقق. كل رقم هنا يُنشر بجانب حجم العينة التي يستند إليها، ودقة النماذج تُعرض منفصلة عن الدقة التي تشمل المحرك الاحتياطي الحتمي: فدمجهما يعني عرض نتيجة عدّاد كلمات على أنها نتيجة نموذج.

GET /api/accuracy/article/{article_id}/

The calls one article produced

Every prediction generated from an article, with its verification state. This is the evidence trail behind a published reading. Every provider appears twice over: ai_provider/provider is the stable tag to key on, and display_name is the name to print. Both are sent because a consumer given only the tag builds its own lookup table, and three such tables inside this project each went stale at a different time -- which is how a raw storage id, carrying the provider name doubled onto a model id that already began with it, reached a page as a model name.

المعاملات

الاسم الموقع النوع مطلوب الوصف
article_id path integer نعم Path segment. Supplied as a integer.

مخطط الاستجابة

4 /api/accuracy/article/{article_id}/
الحقل النوع الوصف
article_id / article_title / article_url / published_at mixed The article the calls came from.
provider_track_record object The weekly record of the engine that read the article. Absent when the article produced no call.
message string Present when the article produced no call.
predictions[] array Every call the article produced, with its verification state — the evidence trail behind a published reading.

مثال على الاستجابة

JSON /api/accuracy/article/{article_id}/
JSON
{
  "article_id": 41,
  "article_title": "Nvidia beats on data-centre revenue as AI demand holds",
  "article_url": "https://example.com/wire/nvidia-q3",
  "published_at": "2026-09-01T06:40:18Z",
  "predictions": [
    {
      "id": 1,
      "symbol": "NVDA",
      "predicted_sentiment": "neutral",
      "ai_provider": "gemini-2.5-flash",
      "display_name": "Gemini 2.5 Flash",
      "timeframe": "6h",
      "outcome_evaluated": true,
      "was_correct": true
    }
  ],
  "provider_track_record": {
    "provider": "gemini-2.5-flash",
    "display_name": "Gemini 2.5 Flash",
    "recent_accuracy": 31.01,
    "total_predictions": 129,
    "badge": "Low Accuracy",
    "badge_color": "red"
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/article/{article_id}/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/article/41/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/article/41/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/article/41/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/accuracy/article/41/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/accuracy/diagnostics/

Evaluation pipeline diagnostics

Queue depth, the age of the oldest open prediction, sample rows from each end, and how the whole prediction record (not the queue) splits by source and timeframe. Published because a benchmark that hides its own backlog is not auditable: a small sample means something different when the queue behind it is large.

مخطط الاستجابة

6 /api/accuracy/diagnostics/
الحقل النوع الوصف
total_pending / total_evaluated / total_failed integer The queue, in three numbers.
by_source object Every prediction on record, in any state, split between news and symbol analysis.
by_timeframe object Every prediction on record, in any state, split across 6h, 24h and 7d horizons.
oldest_pending / newest_pending string (ISO 8601) The age of the backlog.
ready_for_evaluation integer Calls whose horizon has elapsed and which the next scoring run will pick up.
sample_predictions[] / recent_evaluated[] array Rows from each end of the queue, for spot-checking.

مثال على الاستجابة

JSON /api/accuracy/diagnostics/
JSON
{
  "total_pending": 64,
  "total_evaluated": 1539,
  "total_failed": 1,
  "by_source": {
    "news": 1543,
    "symbol_analysis": 61
  },
  "by_timeframe": {
    "6h": 518,
    "24h": 567,
    "7d": 519
  },
  "oldest_pending": "2026-08-30T14:58:18.218215+00:00",
  "ready_for_evaluation": 2
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/diagnostics/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/diagnostics/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/diagnostics/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/diagnostics/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/accuracy/diagnostics/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/accuracy/leaderboard/

Provider accuracy leaderboard

Providers ranked by accuracy. A provider below the minimum sample carries its figure but no rank, so a percentage from three calls cannot be read as a ranking. Every provider appears twice over: ai_provider/provider is the stable tag to key on, and display_name is the name to print. Both are sent because a consumer given only the tag builds its own lookup table, and three such tables inside this project each went stale at a different time -- which is how a raw storage id, carrying the provider name doubled onto a model id that already began with it, reached a page as a model name.

الترقيم والترتيب: Unpaginated — the provider set is small and bounded. min_predictions is a floor on evidence, not a page size: raising it removes providers whose figure rests on too few calls.

المعاملات

الاسم الموقع النوع مطلوب الوصف
period query string لا daily, weekly (default), monthly or all_time.
asset_class query string لا Restrict to one asset class.
source query string لا all (default), news or technical.
timeframe query string لا 6h, 24h or 7d.
min_predictions query integer لا Minimum scored calls to include. Default 0.

مخطط الاستجابة

5 /api/accuracy/leaderboard/
الحقل النوع الوصف
period / asset_class / source / timeframe string The filters the figures cover, echoed back.
min_predictions / min_ranked_sample integer The inclusion floor asked for, and the scored calls a row needs before it carries a rank.
baselines object What always guessing the most common outcome, and guessing at random, would score on the same rows.
leaderboard[] array Rows with rank, provider, display_name, accuracy, total_predictions, correct_predictions, ranked, band, ci_low, ci_high and beats_baseline (whether the whole 95% interval is above the most common outcome of that row's own calls). Empty when nobody clears the minimum sample — an empty board is the honest answer, not a zero.
message string Why the board is empty, when it is.

مثال على الاستجابة

JSON /api/accuracy/leaderboard/
JSON
{
  "period": "all_time",
  "asset_class": "all",
  "source": "all",
  "timeframe": "all",
  "min_predictions": 10,
  "min_ranked_sample": 30,
  "leaderboard": [],
  "message": "No providers with at least 10 predictions in all_time period"
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/leaderboard/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/leaderboard/?period=all_time&min_predictions=10"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/leaderboard/",
    params={"period": "all_time", "min_predictions": 10},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/leaderboard/");
url.search = new URLSearchParams({ period: "all_time", min_predictions: "10" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["period" => "all_time", "min_predictions" => 10]);
$url = "https://www.analystmarkets.com/api/accuracy/leaderboard/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/accuracy/provider/{provider_name}/

One provider's accuracy record

Scored calls, hit rate and sample size for a single provider over a chosen window. Answers 404 when the provider has no record in that window. Every provider appears twice over: ai_provider/provider is the stable tag to key on, and display_name is the name to print. Both are sent because a consumer given only the tag builds its own lookup table, and three such tables inside this project each went stale at a different time -- which is how a raw storage id, carrying the provider name doubled onto a model id that already began with it, reached a page as a model name.

المعاملات

الاسم الموقع النوع مطلوب الوصف
provider_name path string نعم Path segment. Supplied as a string.
period query string لا daily, weekly (default), monthly or all_time.

مخطط الاستجابة

6 /api/accuracy/provider/{provider_name}/
الحقل النوع الوصف
ai_provider / display_name string The provider tag, and the name to print.
time_period / period_start / period_end string Window covered.
total_predictions / correct_predictions integer Sample size, and hits within it.
accuracy_percentage string Percentage over the sample.
accuracy_by_confidence / accuracy_by_sentiment / accuracy_by_asset object The same sample split three ways, each with accuracy, total and correct.
last_updated string (ISO 8601) When the row was computed.

مثال على الاستجابة

JSON /api/accuracy/provider/{provider_name}/
JSON
{
  "ai_provider": "gemini-2.5-flash",
  "display_name": "Gemini 2.5 Flash",
  "time_period": "all_time",
  "total_predictions": 130,
  "correct_predictions": 47,
  "accuracy_percentage": "36.15",
  "accuracy_by_sentiment": {
    "neutral": {
      "accuracy": 23.33,
      "total": 30,
      "correct": 7
    }
  },
  "last_updated": "2026-11-25T05:00:15.116381+03:00"
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/provider/{provider_name}/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/provider/gemini-2.5-flash/?period=all_time"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/provider/gemini-2.5-flash/",
    params={"period": "all_time"},
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/provider/gemini-2.5-flash/");
url.search = new URLSearchParams({ period: "all_time" });

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$query = http_build_query(["period" => "all_time"]);
$url = "https://www.analystmarkets.com/api/accuracy/provider/gemini-2.5-flash/?" . $query;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/accuracy/stats/

Benchmark totals

Scored, pending and excluded prediction counts, and accuracy over every scored prediction, the rule-based engine included. Accuracy over model providers only is rolling_accuracy in /api/metrics/.

مخطط الاستجابة

8 /api/accuracy/stats/
الحقل النوع الوصف
total_evaluated_predictions integer Calls that have been scored against a later price.
correct_predictions integer Of those, how many were right.
overall_accuracy number Percentage over every scored call, the rule-based engine included.
pending_evaluation integer Scored-eligible calls still in the queue. Read it beside the total: a small sample means something different when the queue behind it is large.
failed_evaluation integer Calls scoring could not resolve, usually a missing later price.
active_providers integer Models that wrote a prediction in the last 14 days. The rule-based engines and archived models are not counted.
min_ranked_sample integer Scored calls a provider needs before it carries a rank. The same floor every surface uses; top_performer is chosen on it.
top_performer object or null The most accurate active model. Archived models and the rule-based engines are not considered. Null until at least one active model clears min_ranked_sample. It used to be chosen on a floor of 10 while the pages beside it ranked on 30, so the API named a "top performer" its own platform says is not rankable.

مثال على الاستجابة

JSON /api/accuracy/stats/
JSON
{
  "total_evaluated_predictions": 1539,
  "correct_predictions": 525,
  "overall_accuracy": 34.11,
  "pending_evaluation": 64,
  "failed_evaluation": 1,
  "active_providers": 8,
  "min_ranked_sample": 30,
  "top_performer": null
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/stats/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/stats/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/stats/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/stats/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/accuracy/stats/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/accuracy/symbol/{symbol}/

Accuracy on one asset

How each provider has performed on this symbol, with the sample size behind every figure. Both the per-provider breakdown and the recent predictions carry the naming pair. Every provider appears twice over: ai_provider/provider is the stable tag to key on, and display_name is the name to print. Both are sent because a consumer given only the tag builds its own lookup table, and three such tables inside this project each went stale at a different time -- which is how a raw storage id, carrying the provider name doubled onto a model id that already began with it, reached a page as a model name.

المعاملات

الاسم الموقع النوع مطلوب الوصف
symbol path string نعم Path segment. Supplied as a string.

مخطط الاستجابة

6 /api/accuracy/symbol/{symbol}/
الحقل النوع الوصف
symbol string The asset, uppercased.
total_predictions / correct_predictions integer Scored calls on the asset, and hits within them.
accuracy number Percentage over those calls.
by_provider[] array One row per provider: provider, display_name, accuracy, predictions, correct, ranked and band.
recent_predictions[] array The ten newest scored calls.
message string Present when the asset has no scored call.

مثال على الاستجابة

JSON /api/accuracy/symbol/{symbol}/
JSON
{
  "symbol": "BTC",
  "total_predictions": 6570,
  "correct_predictions": 2429,
  "accuracy": 36.97,
  "by_provider": [
    {
      "provider": "huggingface-prosusai/finbert",
      "display_name": "FinBERT",
      "accuracy": 50.99,
      "predictions": 151,
      "correct": 77,
      "ranked": true,
      "band": "low"
    }
  ],
  "recent_predictions": []
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/accuracy/symbol/{symbol}/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/accuracy/symbol/BTC/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/accuracy/symbol/BTC/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/accuracy/symbol/BTC/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/accuracy/symbol/BTC/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);

الخلاصات

الخلاصات بصيغة XML لا JSON، لذلك ليست في وثيقة OpenAPI. ولا تحتاج إلى مفتاح وليس لها حصة.

المسارالصيغةالوصف
/rss/news.xml RSS 2.0 أحدث 50 مقالة، بالإنجليزية.
/atom/news.xml Atom 1.0 المقالات نفسها بصيغة Atom.
/rss/news/{category}.xml
مثال /rss/news/crypto.xml
RSS 2.0 فئة واحدة أو تبويب واحد من صفحة الأخبار، مثل crypto أو stocks أو commodities أو macro.
/ar/rss/news.xml RSS 2.0 بيانات قناة عربية وروابط مقالات عربية.
cURL
curl --silent --show-error "https://www.analystmarkets.com/rss/news.xml"

عناصر التضمين

شارة دقة لأصل واحد داخل إطار iframe. لا تُعرض إلا حين يتوفر لذلك الرمز الحد الأدنى من التنبؤات المتحقَّق منها — فالأداة التي غايتها إظهار سجل متحقَّق منه لا يحق لها إظهار سجل فارغ.

  • /embed/accuracy/{symbol}/ الأداة نفسها. حمّلها داخل إطار iframe؛ فهي تحمل تنسيقها الخاص ولا تحتاج إلى أي سكربت في صفحتك.
  • /embed/ المولّد: اختر رمزًا، وانسخ المقتطف، وشاهده يعمل على أمثلة حية مختارة من رموز مؤهَّلة فعلًا.

افتح مولّد التضمين ←

سجل التغييرات

الأحدث أولًا، ومتاح بصيغة JSON على /api/changelog.json. المدخلات بالإنجليزية في اللغتين: فسجل التغييرات يُستشهد به عبر المناطق الزمنية وخيوط الدعم، والسطر المترجَم ينحرف عن أصله لحظة تعديل أحدهما.

— v1.3.0

  • deprecatedGET /api/global-markets/: rate_limit_status. Its values were constants that nothing measured; they are null now. Removal on or after 2027-02-23.
  • changedGET /api/global-markets/ reads data_sources.stocks off the rows ("not recorded" where they name no source) and leaves out an index level that is not plausible, in indices and in data_status.indices_count.
  • changedGET /api/accuracy/stats/: active_providers counts the models that wrote a prediction in the last 14 days. It counted every engine on record. top_performer is chosen among active models only.
  • changedGET /api/accuracy/leaderboard/: beats_baseline compares a row with the most common outcome of its own calls.
  • changedGET /api/metrics/: active_models counts models that wrote a news reading in the last 30 days, tracked_providers counts the providers of those models plus the rule-based fallback, and reachable_models counts each provider with a key once.
  • changedGET /api/metrics/: the definition text of evaluated_providers, producing_models, ranking_eligible_models, rolling_accuracy and evaluation_pipeline_status is corrected. Their values are computed as before.
  • changedGET /api/search/palette/: the subtitle of a news result carries the publisher's own name.
  • addedGET /api/metrics/: active_providers, outcomes_changed, scored_results_changed, exclusion_reasons_restated, withdrawn_without_entry and scored_logged_late.
  • changedGET /api/news/: articles[].source and filters.source carry the publisher's own name, and the source filter accepts older spellings of it.
  • changedDocumentation corrected: GET /api/market-data/ has no data_status field and its crypto volume has no single unit, GET /api/health/ is public, GET /api/rate-limits/ is staff-only, and field lists match what the endpoints return.
  • changedThe portal and the OpenAPI document state whether API keys, scopes and hourly budgets are enforced at the moment instead of describing them as always on.

— v1.2.0

  • changedGET /api/accuracy/provider/{provider_name}/ accepts a slash inside the provider tag, which some hosted-model tags carry. Those tags returned 404 before; percent-encoded and literal slashes both resolve now.
  • changedEvery JSON endpoint under /api/ is served at one URL: the language-prefixed twins (/ar/api/...) no longer resolve. Nothing in the documented contract used them.
  • changedAccuracy figures are scored at each prediction's own horizon (6h, 24h, 7d) rather than at the time the scoring job ran. Rows carry exit_price_timestamp; GET /api/metrics/ adds exclusion_rate_recent, producing_models and last_pipeline_run, and GET /api/health/ carries an evaluator block.
  • changedLeaderboard and stats apply one ranking floor (min_ranked_sample); sub-threshold rows are returned with ranked: false instead of being ranked.
  • addedGET /api/news/ reads search, view, symbol and trusted with the same semantics as the news page, and returns ai_sentiment alongside the legacy sentiment field.
  • addedGET /rss/news/{category}.xml resolves the news tabs (macro, equities, high-impact) and returns 404 for an unknown category instead of an empty feed.

— v1.1.0

  • changedAPI keys are stored as SHA-256 digests. A key is now shown once, at creation, and cannot be recovered afterwards — only rotated. Existing keys keep working.
  • addedKeys carry scopes: market_data, news, accuracy and feeds. Calling a route outside a key's scopes returns 403 with insufficient_scope naming the scope required.
  • addedKeys can be rotated in one step at /accounts/api-keys/. Rotation issues the replacement and revokes the previous key immediately; the revoked row is kept so last_used_at and the rotation chain stay readable.
  • addedGET /api/search/palette/ — grouped search across assets, news and platform pages, each result carrying the URL it resolves to.
  • addedPOST /api/telemetry/rum/ and POST /api/telemetry/event/ accept first-party browser beacons. They are documented but deliberately outside the key contract.
  • addedModel detail pages publish each provider's record with the sample size behind every figure.
  • addedRate-limited responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a 429 also carries Retry-After.
  • addedThis developer portal, generated from the OpenAPI document, plus GET /api/changelog.json.
  • changedGET /api/market-data/ is documented against the parameter it reads, symbols. The previously documented asset_class was never read by the endpoint.

— v1.0.0

  • addedGET /api/openapi.json — the machine-readable contract, derived from the URL resolver on each request so it cannot describe a route that no longer exists.
  • addedGET /api/accuracy/diagnostics/ publishes the evaluation queue: depth, exclusion reasons and when scoring last ran.

— v0.9.0

  • addedRSS and Atom feeds at /rss/news.xml, /atom/news.xml, /rss/news/{category}.xml and /ar/rss/news.xml.
  • addedAccuracy embeds at /embed/accuracy/{symbol}/, with a generator at /embed/.

الحالة

تُعرض مع هذه الصفحة. المسار /api/health/ أدناه عام ويعرض حالة الخدمة ومُقيِّم التنبؤات، أما تشخيص المصادر الخارجية فيه فلفريق العمل.

الاعتماديات الخارجية: healthy

الاعتماديةالحالة
coingeckohealthy
yahoohealthy
cryptocomparehealthy
alphavantagehealthy
مجموعة البيانات الحالة العمر طابع وقت البيانات
أسعار العملات الرقمية مباشر live 2 دقيقة 2026-12-03T00:25:03+03:00
المؤشرات متأخر delayed 2 دقيقة 2026-12-03T00:25:13+03:00
الأخبار مباشر live 15 دقيقة 2026-12-03T00:12:00+03:00

سياسة الإيقاف

يُعلَن إيقاف أي مسار منشور أو حقل استجابة في سجل التغييرات قبل 90 يومًا على الأقل من توقفه عن العمل، ويظل يجيب دون تغيير طوال تلك المدة. أما التغييرات الإضافية — نقطة نهاية جديدة أو حقل جديد — فتصدر دون إشعار، لذا حلّل بتسامح وتجاهل الحقول التي لا تعرفها. ولا يتغير معنى حقل قائم تحت الاسم نفسه: المعنى الجديد يأخذ اسمًا جديدًا، فالعميل الذي يستمر في العمل يستمر في الصواب.

في 25 نوفمبر 2026 (الإصدار v1.3.0) لم تُتَّبع هذه السياسة في الحقول المذكورة هنا. فقد تبيّن أن قيمها أو تعريفاتها خاطئة، فصُحّحت فورًا بالاسم نفسه ودون مهلة 90 يومًا. هذا استثناء لذلك الإصدار، والسياسة أعلاه باقية كما هي وتنطبق على التغييرات اللاحقة. ويصف مدخل سجل التغييرات كل تصحيح.

القيم المصحَّحة:

  • /api/global-markets/ rate_limit_status · data_sources.stocks · indices · data_status.indices_count
  • /api/accuracy/stats/ active_providers · top_performer
  • /api/accuracy/leaderboard/ beats_baseline
  • /api/metrics/ active_models · reachable_models · tracked_providers
  • /api/news/ articles[].source · filters.source
  • /api/search/palette/ groups[].items[].subtitle

نص التعريف المصحَّح، والقيم محسوبة كما كانت:

  • /api/metrics/ evaluated_providers · producing_models · ranking_eligible_models · rolling_accuracy · evaluation_pipeline_status
GET /api/health/

Service health

Public, no session needed: liveness, the build, whether rate limits can be enforced, and the state of the prediction evaluator. Intended for monitoring rather than for display. Always 200 when the process can answer at all: the top-level status word degrades when the evaluator is silent for over a day, stuck or failing; the HTTP code does not. A providers block with upstream diagnostics is added for staff only.

مخطط الاستجابة

6 /api/health/
الحقل النوع الوصف
status string ok, or degraded when the prediction evaluator has been silent for more than a day, is stuck or is failing. The HTTP status stays 200 either way: this URL is polled by uptime monitors, and a batch job being behind must not take a web container out of rotation.
service / build / build_short / branch string Which build answered, or unknown.
timestamp string (ISO 8601) When the answer was made.
rate_limit_backend / rate_limit_enforced mixed Where the per-minute counters live, and whether they can be enforced.
evaluator object The prediction evaluator: {status, last_run_at, age_seconds, last_status, stuck_run_id}, read from the pipeline job log rather than inferred from the newest scored row — so a run that scored nothing is still visible as a run. This endpoint used to say nothing about it at all, and the evaluator was dead for three and a half months while every monitor pointed here reported green.
providers object Staff only: the state of each upstream, open circuit breakers and what they imply.

مثال على الاستجابة

JSON /api/health/
JSON
{
  "status": "ok",
  "service": "analystmarkets",
  "timestamp": "2026-09-03T09:05:16+00:00",
  "build": "unknown",
  "build_short": "unknown",
  "branch": "unknown",
  "rate_limit_backend": "redis",
  "rate_limit_enforced": true,
  "evaluator": {
    "status": "ok",
    "last_run_at": "2026-09-03T09:00:04+00:00",
    "age_seconds": 312,
    "last_status": "success",
    "stuck_run_id": null
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/health/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/health/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/health/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/health/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/health/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/metrics/

Every public number the platform states about itself

The canonical metric set: provider counts, the four prediction counts, both accuracy figures, coverage, and the state of the evaluation pipeline — including last_pipeline_run, read from the pipeline job log, which is when scoring last *ran* rather than when it last scored something. Each carries the sentence that defines it and, where it is a share, the population it is a share of. Served from the same service that renders /methodology/ and the site header, so a figure cannot mean one thing on a page and another over the API. The payload also carries computed_at, the methodology_version the scoring rules were at, a partial flag with the keys that could not be computed, and headline_accuracy_key — the one accuracy figure any surface may present as "the" accuracy. Recomputed about every five minutes.

الترقيم والترتيب: None. The whole set is one object; there is no page to walk.

مخطط الاستجابة

15 /api/metrics/
الحقل النوع الوصف
metrics object Metric key to {value, definition, unit, denominator}. value is null for a figure that is not yet measurable — never 0, which would state something false where null states nothing.
metrics.active_models / metrics.active_providers object Models that wrote a reading of a news story in the last 30 days, and the distinct providers they were reached through.
metrics.reachable_models object Model providers with a key configured. Quota and credit are not tested.
metrics.outcomes_changed object Predictions whose row carries a recorded change: re-scored, withdrawn or reclassified, with the previous state kept.
metrics.scored_results_changed object Those of them in which a verdict already given was replaced or withdrawn.
metrics.exclusion_reasons_restated object Excluded predictions whose stated reason was replaced by a later check; the earlier wording was not kept.
metrics.withdrawn_without_entry object Scored results withdrawn without a recorded change on the row.
metrics.scored_logged_late object Scored predictions stored after their own window had closed. They are still in every figure.
computed_at string When this set was computed. Cached five minutes and dropped early by any job that moves one of these numbers.
methodology_version string The scoring ruleset the accuracy figures were produced under.
headline_accuracy_key string Which accuracy metric is the published headline. Two are served, over two populations; this names the one to show.
accuracy_note string One sentence on why there are two accuracy figures and what each is measured over.
partial boolean True when a metric could not be computed. The others are still correct.
failures[] array The keys that could not be computed.
definitions_url string Where every definition is published in prose.

مثال على الاستجابة

JSON /api/metrics/
JSON
{
  "metrics": {
    "predictions_evaluated": {
      "value": 5875,
      "unit": "count",
      "denominator": "",
      "definition": "Predictions whose timeframe closed and which were scored against the realised price move."
    },
    "rolling_accuracy": {
      "value": 29.6,
      "unit": "percent",
      "denominator": "scored predictions from all models, archived included",
      "definition": "The headline accuracy figure. …"
    }
  },
  "computed_at": "2026-09-02T09:00:00+00:00",
  "methodology_version": "v1.0",
  "headline_accuracy_key": "rolling_accuracy",
  "partial": false,
  "failures": [],
  "definitions_url": "https://www.analystmarkets.com/methodology/"
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/metrics/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/metrics/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/metrics/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/metrics/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/metrics/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);
GET /api/rate-limits/ جلسة موظفين

Upstream failure counters

Consecutive failures per upstream data source and when each last failed. It does not report the limits of the calling client.

مخطط الاستجابة

3 /api/rate-limits/
الحقل النوع الوصف
success boolean Whether the snapshot could be taken.
rate_limiting.failure_counts object Consecutive upstream failures per provider.
rate_limiting.last_failure_times object When each last failed.

مثال على الاستجابة

JSON /api/rate-limits/
JSON
{
  "success": true,
  "rate_limiting": {
    "failure_counts": {},
    "last_failure_times": {},
    "timestamp": "2026-09-02T09:00:00+00:00"
  }
}

أمثلة برمجية

cURL · Python · JavaScript · PHP /api/rate-limits/
cURL
curl --silent --show-error \
  "https://www.analystmarkets.com/api/rate-limits/"
Python
import requests

response = requests.get(
    "https://www.analystmarkets.com/api/rate-limits/",
    timeout=10,
)
response.raise_for_status()
data = response.json()
JavaScript
const url = new URL("https://www.analystmarkets.com/api/rate-limits/");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
PHP
<?php
$url = "https://www.analystmarkets.com/api/rate-limits/";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status !== 200) {
    throw new RuntimeException("HTTP $status");
}
$data = json_decode($body, true);