A&C
Apify & Crawlee
O
Apify & Crawlee
•
3y ago
ordinary-sapphire
How to access key-value-stores via api?
I want to access a file I created in key
-value
-stores via api but Store ID keeps changing for every run
. How can I access that file
?
Apify & Crawlee
Join
This is the official developer community of Apify and Crawlee.
13,249
Members
View on Discord
Was this page helpful?
Yes
No
H
HonzaS
•
6/5/23, 6:44 PM
you can change the actor to put the file to the named key
-value
-store then it will be same for all runs
or you can get default key value store id of the run via api
O
ordinary-sapphire
OP
•
6/5/23, 6:57 PM
@HonzaS thanks
, the file is already in
but accessing that file via api url is not possible because it requires Store Id which changes in run time
O
ordinary-sapphire
OP
•
6/5/23, 7:17 PM
do you have an example
?
H
HonzaS
•
6/5/23, 8:22 PM
if you have at least id of the actor
, then you can get list of runs via API
https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs
and then get the id of the last run and then you can get to the keyvaluestore records
just look to the docs
https://docs.apify.com/api/v2#/reference/actor-runs/run-object-and-its-storages
key_value_stores/default
key_value_stores/default