Submit Google Forms by curl command

Google Forms is a very common way to collect user data nowadays. After you have created the form, you could insert it to your web site and present it with your own style.

Other than that, we could integrate Google Forms with the backend job since we could submit the form through command line. Let’s take a look on the following example.

1. Create a new form on your Google drive. The edit page url should be in the following format.



2. View the live form and inspect your field elements to get all the field name.

3. Construct the curl command as follow:

  • curl<form-id>/formResponse -d ifq -d <field-name>=<field-value> -d submit=Submit


In my case the curl command is

  • curl -d ifq -d entry.1202908243=Eureka -d submit=Submit


4. Execute it in shell and that return your the submitted successfully html.

5. If your <field-value> contains special characters like whitespace, wrap the key value pair with double quote.

  • curl -d ifq -d "entry.1202908243=Hello World" -d submit=Submit

    6. You could also submit the whole url without breaking down the parameters. in that case you need to encode the special characters like whitespace. For example if the text contains a whitespace, replace it with %20.

    • curl ""


    6. Check the response spreadsheet.

    Done =)

    Reference: URL Tricks for Google Forms: Pre-populate, and Automatically Submitting Responses

    Update @ 2014-07-31: Thanks Philip for suggesting using the -d parameter in the curl command. =D


12 thoughts on “Submit Google Forms by curl command”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.