이 서비스를 사용하면 스크립트가 URL을 가져와 웹의 다른 리소스에 액세스할 수 있습니다. 스크립트는 UrlFetch 서비스를 사용하여 HTTP 및 HTTPS 요청을 실행하고 응답을 수신할 수 있습니다. UrlFetch 서비스는 효율성과 확장성을 위해 Google의 네트워크 인프라를 사용합니다.
이 서비스를 사용하여 이루어진 요청은 지정된 IP 범위 풀에서 시작됩니다. 이러한 요청을 허용 목록에 추가하거나 승인해야 하는 경우 IP 주소의 전체 목록을 조회할 수 있습니다.
UrlFetch 서비스 요청의 기본 사용자 에이전트 문자열은 Mozilla/5.0 (compatible; Google-Apps-Script; beanserver; +https://script.google.com; id: SCRIPT_ID)입니다.
이 서비스에는 https://www.googleapis.com/auth/script.external_request 범위가 필요합니다. 대부분의 경우 Apps Script는 스크립트에 필요한 범위를 자동으로 감지하고 포함하지만 범위를 명시적으로 설정하는 경우 UrlFetchApp를 사용하려면 이 범위를 수동으로 추가해야 합니다.
[[["이해하기 쉬움","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-07-26(UTC)"],[[["\u003cp\u003eThe URL Fetch service enables Apps Script to make HTTP and HTTPS requests to access external web resources, leveraging Google's infrastructure.\u003c/p\u003e\n"],["\u003cp\u003eRequests originate from a specific range of IP addresses, which can be whitelisted if necessary for security purposes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehttps://www.googleapis.com/auth/script.external_request\u003c/code\u003e scope is required and often automatically included, but needs manual addition for explicitly set scopes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eUrlFetchApp\u003c/code\u003e class handles the fetching process with methods like \u003ccode\u003efetch()\u003c/code\u003e and \u003ccode\u003efetchAll()\u003c/code\u003e, while \u003ccode\u003eHTTPResponse\u003c/code\u003e provides access to response data like headers, content, and status codes.\u003c/p\u003e\n"]]],["The UrlFetch service enables scripts to access web resources via HTTP and HTTPS requests, utilizing Google's network infrastructure. Scripts can fetch URLs using `UrlFetchApp` methods like `fetch` and `fetchAll`. IP ranges are provided for whitelisting purposes. The service requires the `https://www.googleapis.com/auth/script.external_request` scope. `HTTPResponse` methods provide ways to extract response data, headers, and status codes. The user agent is `Mozilla/5.0 (compatible; Google-Apps-Script; beanserver)`.\n"],null,["URL Fetch\n\nThis service allows scripts to access other resources on the web by fetching\nURLs. A script can use the UrlFetch service to issue HTTP and HTTPS requests and\nreceive responses. The UrlFetch service uses Google's network infrastructure for\nefficiency and scaling purposes.\n\nRequests made using this service originate from a set pool of IP ranges. You can [look up the full list of IP addresses](https://www.gstatic.com/ipranges/goog.json)\nif you need to whitelist or approve these requests.\n\nThe default user agent string of UrlFetch service requests is\n`Mozilla/5.0 (compatible; Google-Apps-Script; beanserver; +https://script.google.com; id: `\u003cvar translate=\"no\"\u003eSCRIPT_ID\u003c/var\u003e`)`.\n\nThis service requires the `https://www.googleapis.com/auth/script.external_request`\nscope. In most cases Apps Script automatically detects and includes scopes a script needs, but\nif you are\n[setting your scopes explicitly](/apps-script/concepts/scopes#setting_explicit_scopes)\nyou must manually add this scope to use `Url``Fetch``App`.\n\nSee also\n\n- [HTTPResponse](/apps-script/reference/url-fetch/http-response)\n- [Setting explicit scopes](/apps-script/concepts/scopes#setting_explicit_scopes)\n\nClasses \n\n| Name | Brief description |\n|----------------------------------------------------------------|---------------------------------------------------------------------------|\n| [HTTPResponse](/apps-script/reference/url-fetch/http-response) | This class allows users to access specific information on HTTP responses. |\n| [UrlFetchApp](/apps-script/reference/url-fetch/url-fetch-app) | Fetch resources and communicate with other hosts over the Internet. |\n\n[HTTPResponse](/apps-script/reference/url-fetch/http-response) \n\nMethods\n\n| Method | Return type | Brief description |\n|--------------------------------------------------------------------------------------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [getAllHeaders()](/apps-script/reference/url-fetch/http-response#getAllHeaders()) | `Object` | Returns an attribute/value map of headers for the HTTP response, with headers that have multiple values returned as arrays. |\n| [getAs(contentType)](/apps-script/reference/url-fetch/http-response#getAs(String)) | [Blob](../base/blob.html) | Return the data inside this object as a blob converted to the specified content type. |\n| [getBlob()](/apps-script/reference/url-fetch/http-response#getBlob()) | [Blob](../base/blob.html) | Return the data inside this object as a blob. |\n| [getContent()](/apps-script/reference/url-fetch/http-response#getContent()) | `Byte[]` | Gets the raw binary content of an HTTP response. |\n| [getContentText()](/apps-script/reference/url-fetch/http-response#getContentText()) | `String` | Gets the content of an HTTP response encoded as a string. |\n| [getContentText(charset)](/apps-script/reference/url-fetch/http-response#getContentText(String)) | `String` | Returns the content of an HTTP response encoded as a string of the given charset. |\n| [getHeaders()](/apps-script/reference/url-fetch/http-response#getHeaders()) | `Object` | Returns an attribute/value map of headers for the HTTP response. |\n| [getResponseCode()](/apps-script/reference/url-fetch/http-response#getResponseCode()) | `Integer` | Get the HTTP status code (200 for OK, etc.) of an HTTP response. |\n\n[UrlFetchApp](/apps-script/reference/url-fetch/url-fetch-app) \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| [fetch(url)](/apps-script/reference/url-fetch/url-fetch-app#fetch(String)) | [HTTPResponse](/apps-script/reference/url-fetch/http-response) | Makes a request to fetch a URL. |\n| [fetch(url, params)](/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)) | [HTTPResponse](/apps-script/reference/url-fetch/http-response) | Makes a request to fetch a URL using optional advanced parameters. |\n| [fetchAll(requests)](/apps-script/reference/url-fetch/url-fetch-app#fetchAll(Object)) | [HTTPResponse[]](/apps-script/reference/url-fetch/http-response) | Makes multiple requests to fetch multiple URLs using optional advanced parameters. |\n| [getRequest(url)](/apps-script/reference/url-fetch/url-fetch-app#getRequest(String)) | `Object` | Returns the request that is made if the operation was invoked. |\n| [getRequest(url, params)](/apps-script/reference/url-fetch/url-fetch-app#getRequest(String,Object)) | `Object` | Returns the request that is made if the operation were invoked. |"]]