חיפוש טקסט (חדש) משתמש בבקשות HTTP POST. העברת פרמטרים בגוף הבקשה או בכותרות כחלק מבקשת HTTP POST.
לעומת זאת, בחיפוש טקסט (גרסה קודמת), מעבירים פרמטרים של כתובת URL באמצעות בקשת HTTP GET.
חובה לבצע אנונימיזציה של השדה. צריך לציין אילו שדות רוצים להחזיר בתגובה. אין רשימת ברירת מחדל של שדות שמוחזרים. אם לא מציינים את הרשימה הזו, השיטות מחזירות שגיאה. מידע נוסף מופיע במאמר בנושא FieldMask.
הכלי 'חיפוש טקסט' (חדש) תומך גם במפתחות API וגם באסימוני OAuth כמנגנון אימות.
רק JSON נתמך כפורמט תגובה בחיפוש טקסט (חדש).
חיפוש טקסט (גרסה קודמת) מאפשר לציין קואורדינטות של קו אורך וקו רוחב במחרוזת השאילתה. לדוגמה: query=37.4239,-122.0925.
האפשרות הזו לא נתמכת בחיפוש טקסט (חדש).
פורמט התגובה ב-JSON לחיפוש טקסט (חדש) השתנה מהפורמט של ממשקי ה-API מדור קודם. פרטים נוספים זמינים במאמר בנושא העברת התגובה של Places API.
בטבלה הבאה מפורטים פרמטרים בחיפוש טקסט (גרסה קודמת) ששמם שונה או שהם עברו שינוי בחיפוש טקסט (גרסה חדשה), או פרמטרים שכבר לא נתמכים.
הפרמטר הנוכחי
פרמטר חדש
הערות
evOptions
פרמטר חדש.
language
languageCode
location
locationBias
maxprice/minprice
priceLevels
opennow
openNow
pagetoken
pageToken
query
textQuery
חובה בכל הבקשות.
radius
locationBias
מציינים את הרדיוס כשמגדירים locationBias.
region
regionCode
type
includedType
אפשר להזין רק ערך אחד.
strictTypeFiltering
פרמטר חדש.
דוגמה לבקשה
בדוגמה הבאה מוצגת בקשת GET שמשתמשת בחיפוש טקסט (גרסה קודמת). בדוגמה הזו, אתם מבקשים תגובת JSON שמכילה מידע על "אוכל צמחוני חריף בסידני, אוסטרליה" ומעבירים את כל הפרמטרים כפרמטרים של כתובת URL:
curl -L -X GET \
'https://maps.googleapis.com/maps/api/place/textsearch/json?query=Spicy%20Vegetarian%20Food%20in%20Sydney%20Australia&key=API_KEY
ב-Text Search (חדש), שולחים בקשת POST ומעבירים את כל הפרמטרים בגוף בקשת ה-JSON או בכותרות כחלק מבקשת ה-POST. בדוגמה הזו
נעשה שימוש גם במסכת שדות, כך שהתשובה כוללת רק את השם המוצג ואת
הכתובת המעוצבת של המקום:
[[["התוכן קל להבנה","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-04 (שעון UTC)."],[],[],null,["**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n\nPlaces API (Legacy) supports\n[Text Search (Legacy)](/maps/documentation/places/web-service/legacy/search-text). If you are familiar with\nText Search (Legacy),\n[Text Search (New)](/maps/documentation/places/web-service/text-search)\nmakes the following changes:\n\n- Text Search (New) uses HTTP POST requests. Pass parameters in the request body or in headers as part of an HTTP POST request. In contrast, with Text Search (Legacy), you pass URL parameters using an HTTP GET request.\n- Field masking is required. You must specify which fields you want returned in the response. There is no default list of returned fields. If you omit this list, the methods return an error. For more information, see [FieldMask](/maps/documentation/places/web-service/text-search#fieldmask).\n- Text Search (New) supports both [API keys](/maps/documentation/places/web-service/legacy/get-api-key) and [OAuth](/maps/documentation/places/web-service/legacy/oauth-token) tokens as the authentication mechanism.\n- Only JSON is supported as a response format in Text Search (New).\n- Text Search (Legacy) lets you specify latitude and longitude\n coordinates in the query string. For example: `query=37.4239,-122.0925`.\n That option is not supported in Text Search (New).\n\n Use\n [Reverse Geocoding](/maps/documentation/geocoding/requests-reverse-geocoding)\n to search on coordinates and return an address, or\n [Nearby Search (New)](/maps/documentation/places/web-service/nearby-search)\n to find places around a certain location.\n- The JSON response format for Text Search (New) has changed from the format of the legacy APIs. For more details, see [Migrate the Places API response](/maps/documentation/places/web-service/migrate-response).\n\nThe following table lists parameters in Text Search (Legacy) that have been\nrenamed or modified for Text Search (New), or parameters that are no\nlonger supported.\n\n| Current parameter | New parameter | Notes |\n|---------------------|-----------------------|----------------------------------------------------|\n| | `evOptions` | New parameter. |\n| `language` | `languageCode` | |\n| `location` | `locationBias` | |\n| `maxprice/minprice` | `priceLevels` | |\n| `opennow` | `openNow` | |\n| `pagetoken` | `pageToken` | |\n| `query` | `textQuery` | Required in all requests. |\n| `radius` | `locationBias` | Specify the radius when defining a `locationBias`. |\n| `region` | `regionCode` | |\n| `type` | `includedType` | Only takes a single value. |\n| | `strictTypeFiltering` | New parameter. |\n\nExample request\n\nThe following example GET request uses Text Search (Legacy). In this example, you\nrequest a JSON response containing information about \"Spicy Vegetarian Food in\nSydney, Australia\" and pass all parameters as URL parameters: \n\n```curl\ncurl -L -X GET \\\n'https://maps.googleapis.com/maps/api/place/textsearch/json?query=Spicy%20Vegetarian%20Food%20in%20Sydney%20Australia&key=API_KEY\n```\n\nWith Text Search (New), you make a POST request and pass all parameters in\nthe JSON request body or in headers as part of the POST request. This example\nalso uses a field mask so the response only includes the display name and\nformatted address of the place: \n\n```\ncurl -X POST -d '{\n \"textQuery\" : \"Spicy Vegetarian Food in Sydney, Australia\"\n}' \\\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress' \\\n'https://places.googleapis.com/v1/places:searchText'\n```"]]