We recently announced compatibility of the WP Rest API plugin with the theme. You can easily get your data in JSON format using this plugin with Directory. It will become useful to you if you are thinking to send your data to a third party application.
WP REST API will allow you to send listing information to other applications. It will also make it easier to receive information from other sources. Install the plugin simply and start using it.
Directory have city base URL structure. Thus to get city based data, check the following URL structures. You will need to change the city name, post type slug names there into the URLs. Words are highlighted which needs to be changed.
Get only city details like name, latitude, longitude, map icon, etc…
Syntax – Sitedomain/wp-json/tevolution/v2/city/city_slug/
Example – Sitedomain/wp-json/tevolution/v2/city/philadelphia/
City wise listing details:
Get posts of listing post type with the for specific city
Syntax – Sitedomain/wp-json/tevolution/v2/city/city_slug/post/type/post_type_slug/
Example – Sitedomain/wp-json/tevolution/v2/city/philadelphia/post/type/listing/
Get listings of a category from specific city (By using category ID):
Get posts of listing post type with the filter of city, post type, taxonomy and category id
Syntax – Sitedomain/wp-json/tevolution/v2/city/city_slug/post/type/post_type_slug/taxonomy/taxonomy_slug/category_id/numeric_category_id
Example – Sitedomain /wp-json/tevolution/v2/city/philadelphia/post/type/listing/taxonomy/listingcategory/category_id/7
Get listings of a category from specific city (By using category Name):
Get posts of listing post type with the filter of city, post type, taxonomy and category name.
Syntax – Sitedomain/wp-json/tevolution/v2/city/city_slug/post/type/post_type_slug/taxonomy/taxonomy_slug/category_name/category_slug
Example – Sitedomain/wp-json/tevolution/v2/city/philadelphia/post/type/listing/taxonomy/listingcategory/category_name/place
Get listings of a tag from specific city (By using tag Name):
Get posts of listing post type with the filter of city, post type, taxonomy of tag and taxonomy tag.
Syntax – Sitedomain/wp-json/tevolution/v2/city/city_slug/post/type/post_type_slug/taxonomy/taxonomy_slug/tag_name/tag_slug
Example – Sitedomain/wp-json/tevolution/v2/city/philadelphia/post/type/listing/taxonomy/listingtags/tag_name/place
More details on the plugin’s features are provided here: http://wp-api.org/#posts_retrieve-posts