Get live stock and ETF quotes
curl --request POST \
--url https://api.stophy.dev/v1/finance/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbols": [
"AAPL",
"MSFT",
"NVDA"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({symbols: ['AAPL', 'MSFT', 'NVDA']})
};
fetch('https://api.stophy.dev/v1/finance/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/finance/quote"
payload = { "symbols": ["AAPL", "MSFT", "NVDA"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"quotes": [
{
"symbol": "<string>",
"name": "<string>",
"type": "<string>",
"exchange": "<string>",
"currency": "<string>",
"marketState": "<string>",
"price": 123,
"change": 123,
"changePercent": 123,
"open": 123,
"high": 123,
"low": 123,
"previousClose": 123,
"volume": 123,
"averageVolume": 123,
"marketCap": 123,
"fiftyTwoWeekHigh": 123,
"fiftyTwoWeekLow": 123,
"peRatio": 123,
"forwardPeRatio": 123,
"earningsPerShare": 123,
"dividendYield": 123,
"preMarketPrice": 123,
"postMarketPrice": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
]
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}Finance
Finance quotes API
Call the Finance quotes API to get symbol, name, exchange, currency, market state and price, as JSON or markdown. 1 credit.
POST
/
v1
/
finance
/
quote
Get live stock and ETF quotes
curl --request POST \
--url https://api.stophy.dev/v1/finance/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbols": [
"AAPL",
"MSFT",
"NVDA"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({symbols: ['AAPL', 'MSFT', 'NVDA']})
};
fetch('https://api.stophy.dev/v1/finance/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/finance/quote"
payload = { "symbols": ["AAPL", "MSFT", "NVDA"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"quotes": [
{
"symbol": "<string>",
"name": "<string>",
"type": "<string>",
"exchange": "<string>",
"currency": "<string>",
"marketState": "<string>",
"price": 123,
"change": 123,
"changePercent": 123,
"open": 123,
"high": 123,
"low": 123,
"previousClose": 123,
"volume": 123,
"averageVolume": 123,
"marketCap": 123,
"fiftyTwoWeekHigh": 123,
"fiftyTwoWeekLow": 123,
"peRatio": 123,
"forwardPeRatio": 123,
"earningsPerShare": 123,
"dividendYield": 123,
"preMarketPrice": 123,
"postMarketPrice": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
]
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
finance.quote - Returns:
datahasquotes. - Cost: 1 credit. Failed calls cost nothing.
- Paging: No.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.finance.quote({ symbols: ["AAPL", "MSFT", "NVDA"] });
console.log(result.data.quotes);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.finance.quote(symbols=["AAPL", "MSFT", "NVDA"])
print(result["data"]["quotes"])
curl -X POST https://api.stophy.dev/v1/finance/quote \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"symbols":["AAPL","MSFT","NVDA"]}'
stophy finance quote --symbols AAPL,MSFT,NVDA
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required array length:
1 - 50 elementsPattern:
^[\w.^=-]{1,20}$