import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
stocknewsapi: {
type: "app",
app: "stocknewsapi",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://stocknewsapi.com/api/v1`,
params: {
"tickers-only": `TSLA`,
items: `3`,
page: `1`,
token: `${this.stocknewsapi.$auth.api_key}`,
},
})
},
})
StockNewsAPI uses API keys for authentication. When you connect your StockNewsAPI account, Pipedream securely stores the keys so you can easily authenticate to StockNewsAPI APIs in both code and no-code steps.