How to get the currently running run id inside scraper code?
I would like to get this information to be able to create named datasets based on this run id.
3 Replies
see other env vars here https://docs.apify.com/actors/development/environment-variables
rare-sapphire•3y ago
@Casper you could also use
Actor.getEnv(): https://sdk.apify.com/api/apify/class/Actor#getEnv - then you could use actorRunId property of the returned object: https://sdk.apify.com/api/apify/interface/ApifyEnv#actorRunIdApifyEnv | API | Apify SDK
Parsed representation of the
APIFY_XXX environmental variables.
This object is returned by the {@apilink Actor.getEnv} function.Actor | API | Apify SDK
Actor class serves as an alternative approach to the static helpers exported from the package. It allows to pass configuration
that will be used on the instance methods. Environment variables will have precedence over this configuration.
See {@apilink Configuration} for details about what can be configured and what are the default values.Thanks it looks like what I need. I will test it soon