Wir führen detaillierte Einstellungen für Antwortende ein, damit Ersteller von Formularen besser steuern können, wer antworten darf. Formulare, die nach dem 31. März 2026 mit der API erstellt werden, haben standardmäßig den Status „Nicht veröffentlicht“. Weitere Informationen zu API-Änderungen bei Google Formulare
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit der Google Forms API können Sie Formularinhalte, Einstellungen und Metadaten sowie die Antworten der Endnutzer auf das Formular abrufen. Auf dieser Seite wird beschrieben, wie Sie diese Aufgaben ausführen.
Hinweis
Führen Sie die folgenden Aufgaben aus, bevor Sie mit den Aufgaben auf dieser Seite fortfahren:
Folgen Sie der Anleitung für das Early Adopter-Programm, um die Autorisierung/Authentifizierung und die Einrichtung der Anmeldedaten abzuschließen.
Formularinhalte und ‑metadaten abrufen
Wenn Sie den Inhalt, die Einstellungen und die Metadaten eines Formulars abrufen möchten, rufen Sie die Methode forms.get() mit der Formular-ID auf.
fromapiclientimportdiscoveryfromhttplib2importHttpfromoauth2clientimportclient,file,toolsSCOPES="https://www.googleapis.com/auth/forms.body.readonly"DISCOVERY_DOC="https://forms.googleapis.com/$discovery/rest?version=v1"store=file.Storage("token.json")creds=Noneifnotcredsorcreds.invalid:flow=client.flow_from_clientsecrets("client_secrets.json",SCOPES)creds=tools.run_flow(flow,store)service=discovery.build("forms","v1",http=creds.authorize(Http()),discoveryServiceUrl=DISCOVERY_DOC,static_discovery=False,)# Prints the title of the sample form:form_id="<YOUR_FORM_ID>"result=service.forms().get(formId=form_id).execute()print(result)
importpathfrom'node:path';import{authenticate}from'@google-cloud/local-auth';import{forms}from'@googleapis/forms';// TODO: Replace with a valid form ID.constformID='<YOUR_FORM_ID>';/** * Retrieves the content of a form. */asyncfunctiongetForm(){// Authenticate with Google and get an authorized client.constauth=awaitauthenticate({keyfilePath:path.join(__dirname,'credentials.json'),scopes:'https://www.googleapis.com/auth/forms.body.readonly',});// Create a new Forms API client.constformsClient=forms({version:'v1',auth,});// Get the form content.constresult=awaitformsClient.forms.get({formId:formID});console.log(result.data);returnresult.data;}
Alle Formularantworten abrufen
Wenn Sie alle Antworten aus einem Formular abrufen möchten, rufen Sie die Methode forms.responses.list() mit der Formular-ID auf.
fromapiclientimportdiscoveryfromhttplib2importHttpfromoauth2clientimportclient,file,toolsSCOPES="https://www.googleapis.com/auth/forms.responses.readonly"DISCOVERY_DOC="https://forms.googleapis.com/$discovery/rest?version=v1"store=file.Storage("token.json")creds=Noneifnotcredsorcreds.invalid:flow=client.flow_from_clientsecrets("client_secrets.json",SCOPES)creds=tools.run_flow(flow,store)service=discovery.build("forms","v1",http=creds.authorize(Http()),discoveryServiceUrl=DISCOVERY_DOC,static_discovery=False,)# Prints the responses of your specified form:form_id="<YOUR_FORM_ID>"result=service.forms().responses().list(formId=form_id).execute()print(result)
importpathfrom'node:path';import{authenticate}from'@google-cloud/local-auth';import{forms}from'@googleapis/forms';// TODO: Replace with a valid form ID.constformID='<YOUR_FORM_ID>';/** * Retrieves all responses from a form. */asyncfunctiongetAllResponses(){// Authenticate with Google and get an authorized client.constauth=awaitauthenticate({keyfilePath:path.join(__dirname,'credentials.json'),scopes:'https://www.googleapis.com/auth/forms.responses.readonly',});// Create a new Forms API client.constformsClient=forms({version:'v1',auth,});// Get the list of responses for the form.constresult=awaitformsClient.forms.responses.list({formId:formID,});console.log(result.data);returnresult.data;}
Einzelne Formularantwort abrufen
Wenn Sie eine bestimmte Antwort aus einem Formular abrufen möchten, rufen Sie die Methode forms.responses.get() mit der Formular-ID und der Antwort-ID auf.
fromapiclientimportdiscoveryfromhttplib2importHttpfromoauth2clientimportclient,file,toolsSCOPES="https://www.googleapis.com/auth/forms.responses.readonly"DISCOVERY_DOC="https://forms.googleapis.com/$discovery/rest?version=v1"store=file.Storage("token.json")creds=Noneifnotcredsorcreds.invalid:flow=client.flow_from_clientsecrets("client_secrets.json",SCOPES)creds=tools.run_flow(flow,store)service=discovery.build("forms","v1",http=creds.authorize(Http()),discoveryServiceUrl=DISCOVERY_DOC,static_discovery=False,)# Prints the specified response from your form:form_id="<YOUR_FORM_ID>"response_id="<YOUR_RESPONSE_ID>"result=(service.forms().responses().get(formId=form_id,responseId=response_id).execute())print(result)
importpathfrom'node:path';import{authenticate}from'@google-cloud/local-auth';import{forms}from'@googleapis/forms';// TODO: Replace with a valid form ID.constformID='<YOUR_FORM_ID>';// TODO: Replace with a valid response ID.constresponseID='<YOUR_RESPONSE_ID>';/** * Retrieves a single response from a form. */asyncfunctiongetSingleResponse(){// Authenticate with Google and get an authorized client.constauth=awaitauthenticate({keyfilePath:path.join(__dirname,'credentials.json'),scopes:'https://www.googleapis.com/auth/forms.responses.readonly',});// Create a new Forms API client.constformsClient=forms({version:'v1',auth,});// Get the specified response from the form.constresult=awaitformsClient.forms.responses.get({formId:formID,responseId:responseID,});console.log(result.data);returnresult.data;}
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-16 (UTC)."],[],["The Google Forms API allows retrieving form data and responses. To begin, set up authorization/authentication. To get form content, settings, and metadata, use `forms.get()` with the form ID. To retrieve all responses, use `forms.responses.list()` with the form ID. For a single response, use `forms.responses.get()` with both the form ID and specific response ID. Python and Node.js code examples are provided for each action.\n"],null,[]]