Google Forms API: What Developers Need to Know
Quick answer: The Google Forms API is a REST API for programmatically creating forms, editing questions via batchUpdate, and reading responses from your own application or backend. It's separate from Apps Script, doesn't handle sharing or permissions (that's the Drive API), and doesn't necessarily expose every feature available in the visual Forms editor.
Most people interact with Google Forms through the web editor, but there's also a REST API behind it that developers can call directly from their own code. It's a smaller, more specialized API than something like the Sheets or Drive APIs, and understanding what it actually covers — and what it deliberately leaves to other APIs — saves a lot of trial and error if you're evaluating it for a project. This is a conceptual overview, not a code tutorial: what the API is, what it can and can't do, how it differs from Apps Script, and where it tends to show up in real products.
You can also let AI do the first draft: FormMaker's AI form generator turns a one-line description into a real Google Form you can edit and share.
What the Google Forms API actually is
The Google Forms API is a REST API, part of the broader family of Google Workspace APIs alongside things like the Sheets and Drive APIs. It lets a developer's own application create a new form, add and modify questions, adjust certain form settings, and retrieve submitted responses — all by making HTTP requests, without a human ever opening forms.google.com. It's distinct from Google Apps Script, though the two aren't mutually exclusive: Apps Script code running inside Google's environment can itself call the Forms API, and some developers do exactly that when they need capabilities beyond what the built-in Apps Script Forms service offers.
What it can do
- Create a new form. Programmatically generate a blank form as a starting point for further edits.
- Use batchUpdate to add, modify, or delete questions. The API's primary editing mechanism is a batch update call where you send a list of changes — add this question, change that question's type, delete this one — and Forms applies them together.
- Change form settings. Adjust certain form-level settings through the same batch update mechanism.
- List and get responses. Retrieve submitted responses for a form, either all at once or filtered, so an external system can process them without a human opening the Responses tab.
- Set up watches for new responses. Configure a notification setup, built on Google Cloud Pub/Sub, so your application gets notified when new responses come in rather than having to repeatedly poll for them.
What it explicitly cannot do
- It doesn't fully replicate every editor feature. The visual Forms editor sometimes gets new question types or settings before those capabilities are exposed through the API — always check Google's current documentation for the API rather than assuming feature parity with what you see in the UI.
- It doesn't manage sharing or permissions. Deciding who can view, edit, or collaborate on a form isn't handled by the Forms API at all — that's the responsibility of the separate Google Drive API, since a Form is also a Drive file under the hood.
Getting started, at a concept level
Setting up access follows the same general pattern as other Google APIs:
- Enable the Forms API for your project in Google Cloud Console.
- Set up OAuth 2.0 credentials so your application can request permission to act on behalf of a Google account, since form creation and editing is always tied to a specific account's Drive.
- Use a client library. Google provides official client libraries for several common languages — including Python, Node.js, and Java — that wrap the raw HTTP calls in a more convenient interface, so most developers don't hand-write the REST requests directly.
From there, the typical flow is: authenticate, create or open a form by ID, send batchUpdate calls to shape its questions and settings, and later call the responses endpoint to pull in submissions.
Forms API vs. Apps Script
Both let you automate Google Forms, but they're built for different situations:
- Apps Script runs inside Google's own environment, tied closely to a specific form or Google account. It's the faster option for a quick, one-off automation — like a script that emails you a summary every time a specific form gets a new response.
- The REST API is meant for external applications, backend services, or tools that need to create or manage many forms programmatically, independent of any one person sitting in the Apps Script editor. It's the right layer when Forms functionality needs to be a feature of a larger product rather than a script bolted onto a single form.
Realistic use cases
- A SaaS product that generates Google Forms on behalf of its users. Rather than asking users to build forms by hand, the product calls the Forms API to create and configure a form automatically based on the user's input — broadly the kind of underlying approach FormMaker takes to create real Google Forms through your own Google account, just wrapped in a native mobile interface instead of exposed as a raw API.
- Internal tools that provision forms in bulk. A company might need dozens of near-identical forms generated at once — one per department, one per event, one per class section — which is impractical to do by hand but straightforward with a script calling the API in a loop.
- Syncing form structure from an external database. A team that maintains its canonical list of survey questions in a database or CMS can use the API to keep a live Google Form in sync with that source of truth, rather than manually re-editing the form every time the question set changes.
The resource model: forms, items and responses
Understanding the shape of the data makes the rest of the API much easier to reason about. At a high level, the API works with three things:
- A form, identified by a form ID (the same long ID you see in the editor URL). It has an
infoblock (title, description, and the document title that appears in Drive), asettingsblock (for example quiz settings), a list ofitems, and arevisionIdthat changes as the form is edited. It also exposes aresponderUri— the link respondents use. - Items, which are the entries in the form in order: questions, question groups (grids), section breaks, text blocks, images and videos. Each item has its own ID. A question item wraps a question with its own question ID, and that question ID is what you will see referenced in responses.
- Responses, each with a response ID, timestamps, an optional respondent email (when the form collects it), and a map of answers keyed by question ID. Quiz responses can also include grades.
The practical takeaway: store question IDs, not question titles, when you map answers into your own database. Titles are human text that editors change freely; IDs stay stable for the life of the question.
How editing actually works: create, then batchUpdate
A detail that surprises many first-time users: the create call only sets the form's title (and document title). You cannot send a full form with questions in one create request. The normal pattern is two steps:
- Create the form with a title and keep the returned form ID.
- Send one batchUpdate containing a list of requests that build everything else.
The request types you will use most often in a batchUpdate are:
| Request | Purpose |
|---|---|
updateFormInfo | Change the title or description |
updateSettings | Change form settings, such as turning the form into a quiz |
createItem | Insert a question or other item at a given index |
updateItem | Modify an existing item (with an update mask naming the fields you are changing) |
moveItem | Reorder an item |
deleteItem | Remove an item by index |
Requests in a batch are applied in order, and the batch succeeds or fails as a unit, which keeps a form from ending up half-built. A few points that save debugging time:
- Indexes shift as you insert. If you create five items in one batch, give each one the index it should have after the previous inserts, or simply append them in order.
- Update masks matter. With
updateItemandupdateSettings, fields not named in the mask are left alone; fields named in the mask but missing from your payload may be cleared. Name only what you mean to change. - Use write control for concurrent edits. A batchUpdate can include a required revision ID so the call fails if someone edited the form since you last read it, instead of silently overwriting their change.
- Ask for the result back. batchUpdate can return the updated form in the response, which saves a separate get call when you need the new item and question IDs.
Worked example: provisioning one form per class section
This is an illustrative design, not production code, for a school district tool that creates an identical exit-ticket form for each class section.
- Template in code. Keep the question list (titles, types, choices, required flags) as structured data in your app, not as a hand-built form you try to copy.
- Loop over sections. For each section, call create with a title like "Exit Ticket — Period 3 Biology", then send one batchUpdate with
updateFormInfo(description) followed by acreateItemrequest per question. - Store the mapping. Save the section ID, form ID, responder link and each question ID in your database.
- Share through Drive. Use the Drive API to add the teacher as an editor of their section's form. The Forms API itself has no permission calls.
- Collect results. Either list responses on a schedule using a timestamp filter so you only fetch new submissions, or create a watch so your backend is notified when responses arrive.
Building the form list from data in your code, instead of copying a master form, means a question change is a one-line edit followed by a re-run, and every form stays consistent. If you only need a copy of an existing form, the Drive API's file copy is simpler — see duplicating a Google Form for the manual equivalent.
Reading responses reliably
- List vs get. The list call returns responses for a form (paginated with a page token); the get call returns a single response by ID.
- Incremental sync. The list call supports a filter on submission or update timestamp, so a scheduled job can ask only for responses after the last time it ran. Store that high-water mark carefully and allow for a small overlap to avoid missing edge cases.
- Edited responses. If the form allows response editing, the same response ID can change later. Upsert by response ID instead of inserting blindly.
- Answer shapes differ by type. Choice and text answers arrive as text values, file uploads as file references (Drive file IDs), and grid questions as one answer per row question. Write a small mapping layer instead of assuming every answer is a string.
- The linked Sheet is a separate thing. The API reads responses from the form itself. If your users also rely on a linked response spreadsheet, that is managed in the Forms UI and Sheets, not through the Forms API.
Watches and push notifications
Watches let Google publish an event to a Google Cloud Pub/Sub topic you own when something changes. There are two kinds of event: a change to the form's structure (questions or settings), and a new response. A few practical notes:
- You need a Pub/Sub topic with permission for Google's Forms service to publish to it; the API documentation lists the exact service account to grant.
- Watches expire after a limited period and must be renewed. Build renewal into a scheduled job rather than relying on someone remembering.
- Notifications are signals, not data. The event tells you that a form changed or received responses; your code then calls the responses endpoint to fetch the actual answers.
- Keep a polling fallback. If a watch lapses or a message is missed, a periodic timestamp-filtered list catches anything you did not hear about.
Scopes, verification and data handling
OAuth scopes decide what your app is allowed to do, and choosing the narrowest set is good practice and makes Google's app review smoother. The Forms API has scopes for editing form structure, reading form structure only, and reading responses only; the Drive scopes cover file-level operations. Check Google's current scope list rather than copying one from an old tutorial.
- Request only what you use. A reporting tool that never edits forms should not ask for edit access.
- Expect app verification if a public app requests sensitive or restricted scopes. Plan for it early; it is a process, not a checkbox.
- Treat responses as personal data. Form answers often include names, emails and sometimes sensitive details. Store tokens and response data securely, keep only what you need, and give users a way to disconnect. For the US context, see Google Forms data privacy in the US (general information, not legal advice).
Known limitations to plan around
- File upload questions could not be created through the API at the time of writing; you can read file upload answers, but the question itself has to be added in the editor. Check the current documentation, as this may change. Background on the feature is in Google Forms file upload.
- No submitting responses. The API reads responses; it does not submit them on behalf of a respondent. For pre-populating answers that a person then submits, use a pre-filled link.
- Publishing and accepting responses. Google has been changing how form publishing works, including how API-created forms are published and whether they accept responses. Read the current API reference for publish settings before assuming a newly created form is live.
- Quotas. The API has per-project and per-user rate limits shown in Google Cloud Console. Batch your edits, back off and retry on rate-limit errors, and avoid tight polling loops.
Choosing the right tool: API, Apps Script or no-code
| Need | Good fit | Why |
|---|---|---|
| Email a summary when one form gets a response | Apps Script | Form submit triggers, no server to run; see Apps Script for Google Forms |
| Send each response to a CRM or chat tool | No-code automation | Connectors handle auth and retries; see Google Forms and Zapier |
| Create many forms from data, or forms as a product feature | Forms API | Runs from your own backend with OAuth on behalf of many users |
| Analyze responses in a spreadsheet | Linked Google Sheet | No code needed; Sheets formulas and charts |
| Draft a form quickly without code | An app built on the API | For example FormMaker's AI form generator, which creates a real form in your account |
Common mistakes developers make
- Keying data by question title instead of question ID, then breaking when someone fixes a typo.
- Forgetting that the Forms API cannot share a form, then wondering why collaborators cannot open it.
- Sending the edit URL to respondents instead of the
responderUri. - Letting watches expire silently with no polling fallback.
- Requesting broad Drive scopes when a narrower Forms scope would do, which complicates verification.
FAQ
What is the Google Forms API?
A REST API, part of Google Workspace APIs, that lets developers programmatically create forms, add or edit questions, and read responses from an external application or backend service.
Can the Google Forms API manage sharing and permissions?
No. Managing who can view, edit, or be a collaborator on a form is handled by the separate Google Drive API, not the Forms API itself.
What's the difference between the Forms API and Apps Script?
Apps Script runs inside Google's environment and is well suited to quick automations tied to a single form. The REST API is meant for external applications, backend services, or tools that need to manage many forms programmatically from outside Google's environment.
Does the Google Forms API cover every feature in the Forms editor UI?
Not always. Some newer question types or settings in the visual editor can lag behind or aren't exposed through the API, so it's worth checking Google's current documentation before relying on a specific feature being available.
Can I create a complete form with questions in a single API call?
No. The create call only sets the title. Create the form, then send one batchUpdate containing createItem requests for the questions and any settings changes; the batch is applied as a unit.
Can the Google Forms API submit responses?
No. It can list and read responses but not submit them for a respondent. To pre-fill answers that a person then submits, use a pre-filled link.
How do I get notified about new responses without polling?
Create a watch for response events that publishes to a Google Cloud Pub/Sub topic you own. Watches expire and need renewing, so keep a periodic timestamp-filtered list call as a fallback.