File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -138,20 +138,18 @@ export default function Api() {
138138 < ClientCodeWrapper >
139139 < CodeBlock title = "cURL" language = 'bash' >
140140 { `# Prepare Actor input
141- cat > input.json <<'EOF'
142- {
143- // Define the input in JSON here
144- }
145- EOF
141+ echo '{ "searchStringsArray": ["Apify"] }' > input.json
142+
143+ # Run the Actor and retreive its default dataset id.
144+ curl -X POST -d @input.json -H 'Content-Type: application/json' \\
145+ -s -o >(tee run.json) \\
146+ https://api.apify.com/v2/acts/compass~crawler-google-places/runs?token=<YOUR_API_TOKEN>
146147
147- # Run the Actor
148- curl "https://api.apify.com/v2/acts/username~actorname/runs?token=<YOUR_API_TOKEN>" \\
149- -X POST \\
150- -d @input.json \\
151- -H 'Content-Type: application/json'
148+ # Find the defaultDatasetId in the API response
149+ cat run.json | jq -r .data.defaultDatasetId
152150
153- # Use the defaultDatasetId from response and pass it instead of <DATASET_ID>
154- curl " https://api.apify.com/v2/datasets/<DATASET_ID >/items?token=<YOUR_API_TOKEN>" `
151+ # And pass it instead of <DATASET_ID>
152+ curl https://api.apify.com/v2/datasets/<DATASET >/items?token=<YOUR_API_TOKEN>`
155153 }
156154 </ CodeBlock >
157155 </ ClientCodeWrapper >
You can’t perform that action at this time.
0 commit comments