# From JSON to Java API and back

**URL:** <https://discuss.elastic.co/t/from-json-to-java-api-and-back/4049>\
**Category:** Elasticsearch\
**Created:** [March 7, 2011, 1:18pm UTC](https://discuss.elastic.co/t/from-json-to-java-api-and-back/4049 "2011-03-07T13:18:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paranoiabla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paranoiabla/32/2160_2.png) [@paranoiabla](https://discuss.elastic.co/u/paranoiabla)\
**Post date:** [March 7, 2011, 1:18pm UTC](https://discuss.elastic.co/t/from-json-to-java-api-and-back/4049/1 "2011-03-07T13:18:59Z")

</div>

Hi there,

Im using the Java API and I want to know what is the best way to convert the SearchResponse object into JSON format. Also If Im using the JSON API and I receive back a JSON response, is there a way to convert it to a SearchResponse.

Thank you for your time.

Cheers, Petar.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:10am UTC](https://discuss.elastic.co/t/from-json-to-java-api-and-back/4049/2 "2017-07-06T04:10:39Z")

</div>


