Form oluşturuculara kimlerin yanıt verebileceği konusunda daha fazla kontrol olanağı sunmak için katılımcılarla ilgili ayrıntılı kontrolleri kullanıma sunuyoruz. 31 Mart 2026'dan sonra API ile oluşturulan formlar varsayılan olarak yayınlanmamış durumda olacak. Daha fazla bilgi için Google Formlar'daki API değişiklikleri başlıklı makaleyi inceleyin.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Google Forms API, form içeriğini, ayarlarını ve meta verilerini, ayrıca son kullanıcı form yanıtlarını almanıza olanak tanır. Bu sayfada, bu görevlerin nasıl yapılacağı açıklanmaktadır.
Başlamadan önce
Bu sayfadaki görevlere devam etmeden önce aşağıdaki görevleri gerçekleştirin:
Erken erişim programı talimatlarındaki yetkilendirme/kimlik doğrulama ve kimlik bilgileri kurulumunu tamamlayın.
Form içeriklerini ve meta verilerini alma
Bir formun içeriğini, ayarlarını ve meta verilerini almak için form kimliğiyle forms.get() yöntemini çağırın.
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;}
Tüm form yanıtlarını alma
Bir formdaki tüm yanıtları almak için form kimliğiyle forms.responses.list() yöntemini çağırın.
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;}
Tek bir form yanıtını alma
Bir formdan belirli bir yanıtı almak için forms.responses.get() yöntemini form kimliği ve yanıt kimliğiyle çağırın.
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;}
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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,[]]