Skip to content
Skip to Content
DalalOSdocs

POST /screen/conditions

Query text to conditions, and back

The server is the only parser of query text, in both directions.

In plain words: Turns screen text into a list of conditions and back, so an interface can show and edit a screen.

Try it

To test this route you need an API key on a plan that includes the REST API. Create one on the keys page of your dashboard, paste it into the Authorization field of the reference on this page and press Send. Your key stays in this browser tab.

Query text to conditions, and back
curl -X POST -H "Content-Type: application/json" -d '{"query":"Return on capital employed > 22% AND Market Capitalization > 500","dialect":"screener"}' -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/screen/conditions"
{
  "status": "success",
  "data": {
    "dialect": "screener",
    "query": "Return on capital employed > 22% AND Market Capitalization > 500",
    "representable": true,
    "conditions": [
      {
        "id": "c-5fa03033",
        "kind": "range",
        "representable": true,
        "text": "Return on capital employed > 22%",
        "metric_id": "roce",
        "label": "Return on capital employed",
        "short_label": "ROCE",
        "unit": "percentage",
        "unit_kind": "percent",
        "surface_scale": 100,
        "operator": "gt",
        "value": 22,
        "storage_value": 0.22,
        "indexes": [
          0
        ]
      },
      {
        "id": "c-713a6e7f",
        "kind": "range",
        "representable": true,
        "text": "Market Capitalization > 500",
        "metric_id": "market_cap",
        "label": "Market cap",
        "short_label": "Mkt cap",
        "unit": "currency_crore",
        "unit_kind": "crore",
        "surface_scale": 1e-7,
        "operator": "gt",
        "value": 500,
        "storage_value": 5000000000,
        "indexes": [
          1
        ]
      }
    ]
  },
  "cached_at": null,
  "source": "indian-stock-mcp",
  "stale": false,
  "error": null,
  "reason_code": null
}

Saved answer. Run on 2026-11-27, answered 200. A call you make now gets the current answer.

A call can also answer 402, 403, 409 or 429 when a plan's limit is reached; those are described on Plans, credits and errors.

Request body and response

POST
/screen/conditions

Authorization

bearerAuth
headerAuthorizationBearer <token>

DalalOS API key (isk_live_...) as a Bearer token. Create one in the DalalOS dashboard.

Request Body

Either a query to split, or conditions to render.

application/json
  1. body
conditions?array<>

Conditions to render as query text: {kind: range, metric_id, operator (gt|gte|lt|lte|eq|between), value, value_to?, text?}, {kind: choice, metric_id (a scope key), value} or {kind: text, text}. At most 40. The objects a query request returned can be sent back unchanged.

definitions?array<>

Inline custom ratios the query or text conditions may name, as on POST /screen/query.

dialect?string

screener (Screener.in names) or dalalos (canonical ids). Chips are the same in both; only the text differs.

Default"screener"
query?string

The screen expression to split into conditions. Omit when sending conditions. An empty query is no conditions.

scope?

With query: exact-match classification filters, returned as choice conditions (same object as POST /screen/query).

Response Body

Success (or success-with-empty when nothing is cached).

application/json
  1. response

Standard DalalOS response envelope. source is a per-tool provenance tag; stale/data_age_seconds describe cache freshness.

as_of?string

ISO date (YYYY-MM-DD) the data refers to: the trade date of the newest row, or the end date of the newest period. Present only on tools that state one; cached_at is the fetch time.

Formatdate
cached_at?string

ISO timestamp the served data was refreshed.

data?unknown

Tool payload (object or array); null on error.

data_age_seconds?number

Present only when cached_at is set.

error?string
reason_code?string

Stable machine-readable category (no_data, not_found, bad_request,...).

resolved_via?string

Present only when a query resolved via a rename/merger alias (rename, merger, demerger_successor; single-company result) or, on /v1/search, an everyday name (common_name: the company it means is the first row and carries the same resolved_via on the row; ordinary matches follow).

source?string
stale*boolean
status*string
Value in"success""error"

What comes back

The top-level fields of data in the saved answer, run on 2026-11-27. The fields can differ for another company or window.

Fields of data
FieldType
dialectstring
querystring
representableboolean
conditionslist

Errors

The errors every route can return (401, 402, 403, 429 and the rest) are on Plans, credits and errors.

In MCP

No MCP tool reads this data. Use the REST route.

Notes

  • Send query to get the screen as a list of conditions a chip list can show: each AND-ed condition is a range (one comparison between a numeric field and a number, in the field's display unit and in stored units) or, when the chips cannot say it (an OR, a function, one field against another), a text condition carrying its exact text and a reason -- never dropped or rewritten; scope entries come back as choice conditions.
  • Send conditions to get the query text rendered in the chosen dialect, exact when a condition still carries its text, with the scope its choices stand for.
  • Exactly one of query / conditions.
  • Counts and stored figures only.

Research data only. Answers are disclosed facts and mechanically computed figures. They are not investment advice.

KEEP EXPLORING