Title: Translating JSON/API Results
Last modified: September 1, 2016

---

# Translating JSON/API Results

 *  [mtharani](https://wordpress.org/support/users/mtharani/)
 * (@mtharani)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/translating-jsonapi-results/)
 * I’m hoping that someone has had to do what I’m attempting to do and knows of 
   a WP plugin or even 3rd party solution. I’m using the GeoDirectory plugin and
   trying to connect their recently released API to a mobile development framework
   that supports custom JSON feeds. The issue is that the GeoDirectory API formatting
   is different than what the mobile framework needs to parse. I’ve included a cleaned
   up example of what GeoDirectory produces and what the mobile development framework
   expects. I’m essentially looking to take the input, modify it, and re-output 
   it in the correct format in realtime. Thanks for any help anyone can provide.
 * GeoDirectory Output:
 *     ```
       [
         {
           "id": $id,
           "date": "$date",
           "date_gmt": "$date_gmt",
           "guid": {
             "rendered": "$guid"
           },
           "modified": "$modified",
           "modified_gmt": "$modified_gmt",
           "slug": "$slug",
           "type": "$type",
           "link": "$link",
           "title": {
             "rendered": "$title"
           },
           "content": {
             "rendered": "$content"
           },
           "excerpt": {
             "rendered": "$excerpt"
           },
           "gd_data": {
             "post_id": "$post_id",
             "post_title": "$post_title",
             "post_status": "$post_status",
             "default_category": {
               "raw": "$default_category_raw",
               "rendered": "$default_category_rendered"
             },
             "claimed": "$claimed",
             "is_featured": "$is_featured",
             "featured_image": "$featured_image",
             "post_address": "$post_address",
             "post_city": "$post_city",
             "post_region": "$post_region",
             "post_country": "$post_country",
             "post_zip": "$post_zip",
             "post_latitude": "$post_latitude",
             "post_longitude": "$post_longitude",
             "geodir_contact": "$geodir_contact",
             "geodir_email": "$geodir_email",
             "geodir_website": "$geodir_website",
             "geodir_twitter": "$geodir_twitter",
             "geodir_facebook": "$geodir_facebook",
             "geodir_special_offers": "$geodir_special_offers",
         }
       ]
       ```
   
 * Mobile Framework Supported:
 *     ```
       {
         "dedup": true,
         "generated_in": "0.010000 s",
         "items": [
           {
             "address": "$post_address",
             "author": "",
             "commentsEnabled": false,
             "content": "$content",
             "contentTemplate": null,
             "date": "$date",
             "email": "$geodir_email",
             "id": $post_id,
             "images": [
               {
                 "id": "$post_id",
                 "url": "$featured_image"
               }
             ],
             "isFeatured": "$is_featured",
             "latitude": "$post_latitude",
             "longitude": "$post_longitude",
             "phoneNumber": "$geodir_contact",
             "subsections": {
               "$default_category_raw": [
                 "$default_category_rendered"
               ]
             },
             "subtype": "mcms",
             "summary": "$excerpt",
             "title": "$post_title",
             "type": "maps",
             "website": "$geodir_website"
           }
         ],
         "next_page": null,
         "stat": "ok"
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  [latro666](https://wordpress.org/support/users/latro666/)
 * (@latro666)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/translating-jsonapi-results/#post-7605955)
 * Not really a WP specific answer but have you tried:
    [http://php.net/manual/en/function.json-decode.php](http://php.net/manual/en/function.json-decode.php)
 * Make amends using php and re-encode.

Viewing 1 replies (of 1 total)

The topic ‘Translating JSON/API Results’ is closed to new replies.

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [latro666](https://wordpress.org/support/users/latro666/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/translating-jsonapi-results/#post-7605955)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
