Apify

Apify and Crawlee Official Forum

b
F
A
J
A

Suggestion: JavaScript Fetch Example

On API Console theres is example using CURL, but theres no example using the most used language in the world which is pure JS Fetch. Adding Fetch example may help users a lot.

eg:

Plain Text
const APIFY_TOKEN = "YOUR_APIFY_TOKEN"

var run_inputs  = { "location": "New York" }

var url     = "https://api.apify.com/v2/acts/9avOmybPQaoW1CDas/run-sync-get-dataset-items?token=" + APIFY_TOKEN
var headers     = { "content-type": "application/json" }
var options     = { method: "POST", headers, body: JSON.stringify(run_inputs) }

var response = await fetch(url, options).then(res => res.json())


add another language (PHP, ruby) example might useful to.
Attachment
Screenshot_2024-05-23_090013.png
o
1 comment
Hey, thanks for suggestion. Our docs teams has this in their roadmap but it'll take some time.
Add a reply
Sign up and join the conversation on Discord
Join