Bring stock data into your application
QVeris helps applications and AI agents discover stock data tools and receive structured execution results. Start with a stock quote capability, inspect the required parameters, and use the returned JSON to power a quote card, research table or agent response. Keep the provider’s data alongside its source context.
JSON makes a result easier to parse, but it does not make different providers’ fields interchangeable. Your application still needs to know whether a value is a last trade, daily close, bid or calculated metric. Build one small adapter for the route you choose before trying to support every financial dataset.
If you already use Python, start with the Python stock API example. The same request and validation principles apply in a server-side JavaScript application.
Separate execution from market data
| Layer | What belongs here |
|---|---|
| Execution | Execution ID, outer success/error information and returned result. |
| Provider response | Original market fields, upstream status and any pagination or truncation information. |
| Application record | Your chosen names, typed values, source identifiers and display labels. |
The QVeris API reference describes the execution interface. Treat your application record as a transformation you own. Do not describe a custom object as the universal QVeris response schema, and do not discard upstream error information just because the HTTP request completed successfully.
Define a small, explicit quote record
The following object is an illustrative application model, not a live quote or an actual QVeris response. Null values intentionally represent data that has not been retrieved. Fill them only after validating a real result.
{
"instrument": {"symbol": "AAPL", "currency": null},
"quote": {"price": null, "price_type": null},
"observed_at": null,
"retrieved_at": null,
"source": {"provider": null, "tool_id": null},
"status": "not_fetched"
}Give observation time and retrieval time separate fields. Store missing data as missing rather than zero. JSON supports strings, numbers, booleans, arrays, objects and null; choose the type deliberately instead of letting a spreadsheet import decide it later. See RFC 8259 for the data format.
Validate before you render or export
Check the HTTP status, parse the JSON, inspect the execution outcome and then validate the provider payload. Confirm the instrument and check the timestamp before showing a number as current. A response can be valid JSON while containing an error message, an empty object or only part of a larger dataset.
Use explicit mapping rules for each route. If a provider returns a numeric value as a string, convert it only after checking that the string is a valid number and that its unit is known. Preserve the original value when precise decimal handling matters. Reject unexpected object shapes instead of searching recursively for any field called “price”.
For CSV output, choose columns from your normalized model, write a header and include source/time columns. CSV conversion is an application step unless the selected tool explicitly supplies a download format. It should not be advertised as a built-in export you have not implemented.
Connect the record to a useful workflow
A quote card needs a small current snapshot. A chart needs a dated array of observations. A company research page needs entity information as well as market values. Use the history workflow or company profile workflow when the user’s task requires those records.
In an AI agent, give the model both the validated values and their source labels. Ask it to explain missing fields instead of guessing them. Review QVeris trial and call pricing before turning an interactive test into an automatic refresh loop. You can use the task below to inspect a real response before designing the final adapter.
Frequently asked questions
Does JSON guarantee identical fields across providers?
No. JSON is a data format. Inspect each route and define a mapping for the fields that your application needs.
Can I put my QVeris key in frontend JavaScript?
Keep account credentials on your server. A backend can call QVeris and return only the data your frontend needs.
Turn an AAPL quote into app-ready JSON
Open the prefilled QVeris task to inspect and call an AAPL quote tool. It will map the actual price, observation time and provider fields into a compact application JSON record while keeping missing values null and preserving the source.
Use QVeris to inspect and call a stock quote capability for AAPL. Show which returned fields describe price, observation time and provider. Propose a small JSON application record, clearly distinguishing it from the raw response. Keep missing values null, preserve the source, and explain any provider error or truncation. Do not invent market values. Respond in English.
