geobaseTree
Get a geography reference.
Request format
https://adfox.yandex.com/api/v1
? object=account
& action=utility
& actionObject=geobaseTree
& [hideChildren=<integer>]
& [regionID=<integer>]
|
Display child elements of regions. Acceptable values:
Default value: |
|
Initial node of the tree. The display of the tree begins with its child objects. Default value: |
* Required
Response format
<response>
<status>
<code>{integer}</code>
</status>
<result>
<rows>{integer}</rows>
<data>
<rowN>
<id>{integer}</id>
<name_ru>{string}</name_ru>
<children_count>{integer}</children_count>
</rowN>
<rowN>
<id>{integer}</id>
<name_ru>{string}</name_ru>
<children_count>{integer}</children_count>
</rowN>
<rowN>...</rowN>
<rowN>...</rowN>
...
<rowN>...</rowN>
</data>
</result>
</response>
Response parameters
|
Request processing status. If the value is |
|
Number of items in the response tree. |
|
Item number in the response tree, where N is a number from 0 to rows-1 (where |
|
Region ID. |
|
Country name. |
|
The element has child regions, which are listed inside the tag (shown if the |
|
The element has child regions, and the number of child regions is specified inside the tag (shown if the |
Sample request and response
Complete responseShort responseRequest:
https://adfox.yandex.com/api/v1?object=account&action=utility&actionObject=geobaseTree®ionID=225
Response:
<response> <status> <code>0</code> </status> <result> <rows>9</rows> <data> <row0> <id>3</id> <name>Central Federal District</name> <children> <row0> <id>1</id> <name>Moscow and Moscow Oblast</name> <children> <row0> <id>213</id> <name>Moscow</name> <children/> </row0> </children> </row0> <row1>...</row1> <row2>...</row2> </children> </row0> <row1>...</row1> <row2>...</row2> ... <row8>...</row8> </data> </result> </response>
Request:
https://adfox.yandex.com/api/v1?object=account&action=utility&actionObject=geobaseTree®ionID=225
Response:
<response> <status> <code>0</code> </status> <result> <rows>9</rows> <data> <row0> <id>3</id> <name>Central Federal District</name> <children> <row0> <id>1</id> <name>Moscow and Moscow Oblast</name> <children> <row0> <id>213</id> <name>Moscow</name> <children/> </row0> </children> </row0> <row1>...</row1> <row2>...</row2> </children> </row0> <row1>...</row1> <row2>...</row2> ... <row8>...</row8> </data> </result> </response>
Request:
https://adfox.yandex.com/api/v1?object=account&action=utility&actionObject=geobaseTree&hideChildren=1®ionID=10000
Response:
<response> <status> <code>0</code> </status> <result> <rows>8</rows> <data> <row0> <id>138</id> <name_ru>Australia and Oceania</name_ru> <children_count>2</children_count> </row0> <row1> <id>183</id> <name_ru>Asia</name_ru> <children_count>8</children_count> </row1> <row2>...</row2> <row3>...</row3> ... <row7>...</row7> </data> </result> </response>
Initial node of the tree. The display of the tree begins with its child objects.
Default value: 10,000
— Whole world.
Required
Display child elements of regions.
Acceptable values:
-
0
: A complete response with child elements displayed. -
1
: A short response with child elements hidden. The number of such elements is displayed in thechildren_count
field.
Default value: 0
.