Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API returns 0 results for basic search query. #522

Closed
omurbekjk opened this issue Oct 22, 2019 · 2 comments
Closed

API returns 0 results for basic search query. #522

omurbekjk opened this issue Oct 22, 2019 · 2 comments

Comments

@omurbekjk
Copy link

Request:

curl -X GET "http://catalog.api.2gis.ru/2.0/region/search?key=MY_KEY&q=vefa%20center&country_code_filter=kg" -H "accept: application/json"

http://catalog.api.2gis.ru/2.0/region/search?key=rumvfg5161&q=vefa%20center&country_code_filter=kg

result:

{
  "meta": {
    "api_version": "2.0.347855",
    "code": 404,
    "error": {
      "message": "Results not found",
      "type": "itemNotFound"
    },
    "issue_date": "20191022"
  }
}

What am I doing wrong?

Also try it out option in this link does not work.
http://catalog.api.2gis.ru/doc/2.0/suggest/#/default/get_2_0_suggest_list

@omurbekjk
Copy link
Author

@Trufi @scherebedov please help

@alxart
Copy link
Contributor

alxart commented Oct 23, 2019

Hi, Omurbek
Search API is not relevant to Maps API. Please, send your questions through the feedback form next time. Feedback form

Region search is used to find cities and regions. For example:
http://catalog.api.2gis.ru/2.0/region/search?key=YOUR_KEY&q=%D0%91%D0%B8%D1%88%D0%BA%D0%B5%D0%BA&country_code_filter=kg
or
http://catalog.api.2gis.ru/2.0/region/search?key=YOUR_KEY&q=Bishkek&country_code_filter=kg

A server response in this case:
{ "meta": { "api_version": "2.0.347855", "code": 200, "issue_date": "20191023" }, "result": { "items": [ { "id": "112", "name": "Бишкек", "type": "region" } ], "total": 1 } }

To find the "VEFA Center" you need to use geo search.
http://catalog.api.2gis.ru/2.0/geo/search?key=YOUR_KEY&q=vefa%20center&region_id=112

A server response will be:
{ "meta": { "api_version": "2.0.347855", "code": 200, "issue_date": "20191023" }, "result": { "items": [ { "purpose_name": "Торговый центр", "name": "VEFA Center, торговый центр", "full_name": "Бишкек, VEFA Center, торговый центр", "id": "15763234351159408", "building_name": "VEFA Center, торговый центр", "address_name": "Байтик Баатыра, 98 / Максима Горького, 27/1", "type": "building" } ], "total": 1 } }

@alxart alxart closed this as completed Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants