Actor picture

MySQL Insert


This act takes a crawler execution and inserts it's results into a remote MySQL database.

No credit card required

Author's avatarPetr Cermak
  • Modified
  • Users42
  • Runs65,976

Apify actor for inserting crawler results into a remote MySQL table.

This actor fetches all results from a specified dataset (or as raw data) and inserts them into a table in a remote MySQL database.


Input is a JSON object with the following properties:

    "datasetId": "your_dataset_id",
    "connection": {
        "host"      : "host_name",
        "user"      : "user_name",
        "password"  : "user_password",
        "database"  : "database_name", // optional
        "port"      : 3306 // optional
    "table": "table_name",
    // Optionally, you can add raw data instead of datasetId
    "rows": [
        {"column_1": "value_1", "column_2": "value_2"},
        {"column_1": "value_3", "column_2": "value_4"}


Very often you want to run an image mysql-insert update after every run of your scraping/automation actor. Webhooks are solution for this. The default datasetId will be passed automatically to the this actor's run so you don't need to set it up in the payload template (internally the actor transforms the resource.defaultDatasetId from the webhook into just datasetId for its own input).

I strongly recommend to create a task from this actor with predefined input that will not change in every run - the only changing part is usually datasetId. You will not need to fill up the payload template and your webhook URL will then look like:<YOUR-TASK-ID>/runs?token=<YOUR_API_TOKEN>


See how MySQL Insert is used in industries around the world