Text Search में माइग्रेट करें (नया)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यूरोपियन इकनॉमिक एरिया (ईईए) के डेवलपर
परिचय
Places API (लेगसी), Text Search (लेगसी) के साथ काम करता है. अगर आपको टेक्स्ट सर्च (लेगसी) के बारे में जानकारी है, तो टेक्स्ट सर्च (नया) में ये बदलाव किए गए हैं:
- टेक्स्ट सर्च (नया वर्शन), एचटीटीपी पोस्ट अनुरोधों का इस्तेमाल करता है. अनुरोध के मुख्य हिस्से या हेडर में, एचटीटीपी पोस्ट अनुरोध के हिस्से के तौर पर पैरामीटर पास करें.
इसके उलट, टेक्स्ट सर्च (लेगसी) में, एचटीटीपी जीईटी अनुरोध का इस्तेमाल करके यूआरएल पैरामीटर पास किए जाते हैं.
- फ़ाइल मास्क करना ज़रूरी है. आपको यह बताना होगा कि रिस्पॉन्स में आपको कौनसे फ़ील्ड चाहिए. लौटाए गए फ़ील्ड की कोई डिफ़ॉल्ट सूची नहीं होती. इस सूची को शामिल न करने पर, ये तरीके गड़बड़ी दिखाते हैं. ज़्यादा जानकारी के लिए, FieldMask देखें.
- टेक्स्ट खोज (नया) सुविधा, पुष्टि करने के तरीके के तौर पर एपीआई पासकोड और OAuth टोकन, दोनों के साथ काम करती है.
- टेक्स्ट सर्च (नया) में, रिस्पॉन्स फ़ॉर्मैट के तौर पर सिर्फ़ JSON का इस्तेमाल किया जा सकता है.
टेक्स्ट सर्च (लेगसी) की मदद से, क्वेरी स्ट्रिंग में अक्षांश और देशांतर के निर्देशांक तय किए जा सकते हैं. उदाहरण के लिए: query=37.4239,-122.0925
.
यह विकल्प, टेक्स्ट खोज (नया वर्शन) में काम नहीं करता.
निर्देशांकों के आधार पर खोज करने और पता पाने के लिए, रिवर्स जियोकोडिंग का इस्तेमाल करें. इसके अलावा, किसी जगह के आस-पास की जगहों को खोजने के लिए, आस-पास की जगहें खोजने की सुविधा (नई) का इस्तेमाल करें.
- Text Search (New) के लिए JSON रिस्पॉन्स फ़ॉर्मैट, लेगसी एपीआई के फ़ॉर्मैट से बदल गया है. ज़्यादा जानकारी के लिए, Places API के रिस्पॉन्स को माइग्रेट करना लेख पढ़ें.
यहां दी गई टेबल में, टेक्स्ट सर्च (लेगसी) के उन पैरामीटर की सूची दी गई है जिनके नाम बदले गए हैं या जिनमें टेक्स्ट सर्च (नया) के लिए बदलाव किए गए हैं. इसमें उन पैरामीटर की सूची भी दी गई है जो अब काम नहीं करते.
मौजूदा पैरामीटर |
नया पैरामीटर |
नोट |
|
evOptions |
नया पैरामीटर. |
language |
languageCode |
|
location |
locationBias |
|
maxprice/minprice |
priceLevels |
|
opennow |
openNow |
|
pagetoken |
pageToken |
|
query |
textQuery |
सभी अनुरोधों में इसकी ज़रूरत होती है. |
radius |
locationBias |
locationBias तय करते समय, रेडियस की जानकारी दें. |
region |
regionCode |
|
type |
includedType |
इसमें सिर्फ़ एक वैल्यू डाली जा सकती है. |
|
strictTypeFiltering |
नया पैरामीटर. |
अनुरोध का उदाहरण
नीचे दिए गए जीईटी अनुरोध के उदाहरण में, टेक्स्ट सर्च (लेगसी) का इस्तेमाल किया गया है. इस उदाहरण में, "ऑस्ट्रेलिया के सिडनी में मिलने वाले मसालेदार शाकाहारी खाने" के बारे में जानकारी देने वाले JSON जवाब का अनुरोध किया गया है. साथ ही, सभी पैरामीटर को यूआरएल पैरामीटर के तौर पर पास किया गया है:
curl -L -X GET \
'https://maps.googleapis.com/maps/api/place/textsearch/json?query=Spicy%20Vegetarian%20Food%20in%20Sydney%20Australia&key=API_KEY
टेक्स्ट सर्च (नया) की मदद से, POST अनुरोध किया जाता है. साथ ही, सभी पैरामीटर को JSON अनुरोध के मुख्य हिस्से में या POST अनुरोध के हिस्से के तौर पर हेडर में पास किया जाता है. इस उदाहरण में फ़ील्ड मास्क का भी इस्तेमाल किया गया है, ताकि जवाब में सिर्फ़ जगह का डिसप्ले नेम और फ़ॉर्मैट किया गया पता शामिल हो:
curl -X POST -d '{
"textQuery" : "Spicy Vegetarian Food in Sydney, Australia"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \
-H 'X-Goog-FieldMask: places.displayName,places.formattedAddress' \
'https://places.googleapis.com/v1/places:searchText'
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया."],[],[],null,["# Migrate to Text Search (New)\n\n**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------------\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---------------\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```"]]