Send Instagram DMs and like each user's latest post

How to send Instagram DMs and like each user's latest post: install the Chrome extension, click Build from description, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.

Here is how the automation works. To send Instagram DMs and like each user's latest post, loop through a Google Sheet of profile links with Loop through data, open each profile and, when it shows a Message button, send the row's text with Enter text inside an If condition, then open the user's newest post and like it with Click element set to Optional click, so a post already liked, which shows Unlike instead, is skipped rather than failing the run. Finally it writes Sent and liked back into the row so the next run skips it.

Author
Alex Barlow
Published

Build the Instagram DM and like from a description


Describe it and click the button: the agent builds and tests the DM and like automation in your Chrome extension. Instagram has to be signed in in the browser the automation runs in. For the DM alone, see send Instagram DMs from a Google Sheet.

  1. Read the profile links and messages from my sheet
  2. Skip any rows already marked Sent and liked
  3. Open each profile link
  4. Check the profile header for the word Message
  5. If it is there, click Message and send the message
  6. Then open their newest post and like it
  7. Write Sent and liked back into the row, column C
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

You need a Google Sheet with the Instagram profile link in column A and the message in column B, one row per user under a header row, and column C empty for the marker. Each row is marked Sent and liked as it is done, so a stopped run picks up where it left off without messaging anyone twice. Start with a handful of rows: too many DMs in a short time gets an Instagram account suspended.

The video shows the agent building the Instagram DM and like automation from the lines above, in a few minutes.

Build the Instagram DM and like step by step


The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.

  • 1.0 Enter custom data
    • Custom data: Sent and liked
  • 2.0 Read data from a Google Sheet
    • Spreadsheet: your sheet, the profile link in column A and the message in column B
    • First cell: A2
    • Last cell: far enough right to include column C
  • 3.0 Remove results that contain certain words
    • Data: [google-sheet-data]
    • Words (comma separated): [custom-data]
  • 4.0 Loop through data
    • repeats for every row in [word-removed-data]
    • 4.1 Go to page
      • URL: column A of [word-removed-data]
    • 4.2 Get data from bot's current page
      • Select: the profile header, the area holding the Message button
    • 4.3 If condition
      • Data to check: [scrape-data]
      • Condition to check: Message, in the word Instagram shows in your language
      • Reverse condition: Run steps if condition is true
      • 4.3.1 Click element
        • Select: the Message button
        • Click: Custom with Use element text instead of HTML on
      • 4.3.2 Wait
      • 4.3.3 Enter text
        • Select text field: the conversation's text box
        • Text: column B of [word-removed-data]
      • 4.3.4 Press key(s)
        • Key: Return
    • 4.4 Go to page
      • URL: column A of [word-removed-data]
    • 4.5 Click element
      • Select: the first post in the profile's grid
    • 4.6 Click element
      • Select: the post's Like button, picked by the label or text that says Like, so the Unlike button on a post already liked does not match (see the questions below)
      • Optional click: on, so a post already liked matches nothing and is skipped
    • 4.7 Find row in a Google Sheet
      • Spreadsheet: your sheet
      • Values (comma separated): column A of [word-removed-data]
      • Exact match: on
      • Columns (optional): 1
    • 4.8 Write data to a Google Sheet
      • Spreadsheet: your sheet
      • DATA: [custom-data]
      • Write options: Add to existing data
      • Starting cell: C[find-row-google-sheet]

Common questions about Instagram DMs and likes


What happens on a profile with no Message button?

The If condition skips the message steps and the run goes on to like the post, so a private or blocked profile does not stop the batch. The row is still marked Sent and liked, as the like went through. If a run does fail, hand it to the agent and it repairs the step.

Will it unlike a post that is already liked?

It can, if the selector matches the heart whatever its state. On a post you already liked the same button reads Unlike, and clicking it takes the like away. The heart carries a label saying which it is, usually aria-label="Like" on the button or on the svg inside it, which reads Unlike once liked. Select the button by that label, or by its text with Use element text instead of HTML on, so only the Like state matches. With Optional click on, a post already liked then matches nothing and the step is skipped. If you are not sure the selector does this, hand the automation to the agent and ask it to check.

Can I personalise each Instagram DM?

Yes. Add columns for the name or anything else to the sheet, and pass them into the message in Enter text as data from the row. To build a longer message from several columns, see send Instagram DMs from a Google Sheet.

How many Instagram DMs can I send a day?

Typically 20 to 50 a day from a new account, and 100 to 150 from an established one. Start low and raise the number until you reach the limit.

Will my Instagram account get blocked for sending DMs?

It can. If you go over Instagram's DM limits the account is most likely suspended, and going over them again and again risks a block.

How do I control how many Instagram DMs the automation sends?

Set Maximum cycles on Loop through data. For example, 20 sends 20 DMs a run, and the next run carries on from the first row not yet marked.

Can I run the Instagram DM and like automation on a schedule?

Yes. Save the automation and set a schedule. Each run skips the rows marked Sent and liked and sends the next batch, so a batch a day works through the list. Keep each batch within Instagram's daily limits.

Can I automate other Instagram tasks the same way?

Yes. The same steps can log in and out of Instagram accounts, though that is not a good fit for a large number of accounts. See automate 2FA login for Instagram and scrape Instagram users from a hashtag.

Where do I get help?

Get in touch with support, or ask in the axiom.ai community.

Related guides