हम फ़ॉर्म बनाने वालों को यह तय करने के लिए ज़्यादा कंट्रोल दे रहे हैं कि कौन जवाब दे सकता है. इसके लिए, हम जवाब देने वालों के लिए ज़्यादा कंट्रोल वाली सेटिंग लॉन्च कर रहे हैं. एपीआई का इस्तेमाल करके 31 मार्च, 2026 के बाद बनाए गए फ़ॉर्म, डिफ़ॉल्ट रूप से अनपब्लिश किए गए होंगे. ज़्यादा जानने के लिए, Google Forms में एपीआई से जुड़े बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google Forms API की मदद से, फ़ॉर्म का कॉन्टेंट, सेटिंग, और मेटाडेटा वापस पाया जा सकता है. साथ ही, इससे फ़ॉर्म भरने वाले व्यक्ति के जवाब भी वापस पाए जा सकते हैं. इस पेज पर, इन टास्क को पूरा करने का तरीका बताया गया है.
शुरू करने से पहले
इस पेज पर दिए गए टास्क पूरे करने से पहले, ये टास्क पूरे करें:
Early Adopter Program के निर्देशों में दिए गए तरीके से, अनुमति/पुष्टि करने और क्रेडेंशियल सेट अप करने की प्रोसेस पूरी करें.
फ़ॉर्म के कॉन्टेंट और मेटाडेटा को वापस पाना
किसी फ़ॉर्म का कॉन्टेंट, सेटिंग, और मेटाडेटा वापस पाने के लिए, फ़ॉर्म आईडी के साथ forms.get() तरीके का इस्तेमाल करें.
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;}
फ़ॉर्म के सभी जवाब वापस पाना
किसी फ़ॉर्म के सभी जवाब पाने के लिए, फ़ॉर्म आईडी के साथ forms.responses.list() तरीके को कॉल करें.
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;}
किसी फ़ॉर्म में मिले जवाब को वापस पाना
किसी फ़ॉर्म से कोई खास जवाब पाने के लिए, फ़ॉर्म आईडी और जवाब के आईडी के साथ forms.responses.get() तरीके को कॉल करें.
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;}
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 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,[]]