Connecting to Apify
Using API Key Authentication
To use the Apify API, you need to obtain an API token from your Apify Console. Navigate to the Settings section and generate a new API token.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your Apify API token from the Console.
Example connection string:
Profile=C:\profiles\Apify.apip;AuthScheme=APIKey;ProfileSettings="APIKey=apify_api_xxx"
Usage Examples
Actor Management
Get all actors:
SELECT * FROM Actors
Get specific actor:
SELECT * FROM Actors WHERE Id = 'actor-id'
Actor Task Operations
Get all actor tasks:
SELECT * FROM ActorTasks
Get specific actor task:
SELECT * FROM ActorTasks WHERE Id = 'your-task-id'
Actor Run Monitoring
Get all actor runs:
SELECT * FROM ActorRuns
Filter runs by status:
SELECT * FROM ActorRuns WHERE Status = 'SUCCEEDED'
Filter runs by status:
SELECT * FROM ActorRuns WHERE ActorId = 'your-actor-id'
Actor Task Runs
Get task runs with status filter:
SELECT * FROM ActorTaskRuns WHERE TaskId = 'your-task-id' AND Status = 'RUNNING'
Actor Builds
Get all actor builds:
SELECT * FROM ActorBuilds WHERE ActorId = 'your-actor-id'
Actor Versions
Get actor versions:
SELECT * FROM ActorVersions WHERE ActorId = 'your-actor-id'
Environment Variables
Get environment variables for specific actor version:
SELECT * FROM ActorVersionEnvironmentVariables WHERE ActorId = 'your-actor-id' AND VersionNumber = '1.0'
Dataset Management
Get all datasets:
SELECT * FROM Datasets
Get unnamed datasets only:
SELECT * FROM Datasets WHERE IncludeUnNamed = true
Key-Value Store Operations
Get all key-value stores:
SELECT * FROM KeyValueStores
Get keys from a specific store:
SELECT * FROM KeyValueStoreKeys WHERE StoreId = 'your-store-id' AND Prefix = 'config'
Request Queue Management
Get all request queues:
SELECT * FROM RequestQueues
Get requests from a queue:
SELECT * FROM Requests WHERE QueueId = 'your-queue-id' AND ClientKey = 'your-client-key'
Request Locks
Get request locks:
SELECT * FROM RequestLocks WHERE QueueId = 'your-queue-id' AND ClientKey = 'your-client-key'
Schedule Management
Get all schedules:
SELECT * FROM Schedules
Get schedule logs:
SELECT * FROM ScheduleLogs WHERE ScheduleId = 'your-schedule-id'
Apify Store
Browse the Apify Store:
SELECT * FROM Store
Search store with filters:
SELECT * FROM Store WHERE Search = 'scraper' AND Category = 'E-commerce'
Filter by username:
SELECT * FROM Store WHERE UserName = 'specific-username' AND SortBy = 'popularity'
User Information
Get current user details:
SELECT * FROM Users
Get user account limits:
SELECT * FROM UserLimits
Get monthly usage statistics:
SELECT * FROM UserMonthlyUsage WHERE Date = '2024-01-01'
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | Your Apify API token from the Apify Console. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |