# How to profile a non-html Rails 4?

**URL:** <https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245>\
**Category:** Ruby\
**Created:** [March 19, 2014, 10:37am UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245 "2014-03-19T10:37:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlecour](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/jlecour/32/971_2.png) [@jlecour](https://community.miniprofiler.com/u/jlecour)\
**Post date:** [March 19, 2014, 10:37am UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/1 "2014-03-19T10:37:23Z")

</div>

Hi,

I’m working on a Rails 4.1.rc1 app. It’s an API that renders only JSON resources. I’d like to use `rack-mini-profiler` to look at some portions of code.

Is it the right tool? How to do this without an HTML page to inject results into?

Thanks.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [March 19, 2014, 9:49pm UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/2 "2014-03-19T21:49:11Z")

</div>

Should work fine, but you will need some custom work grabbing the results, it includes the profile guid in headers for each req, you can harvest them using json calls later.

---

<div class="post-metadata">

**Author:** ![jlecour](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/jlecour/32/971_2.png) [@jlecour](https://community.miniprofiler.com/u/jlecour)\
**Post date:** [March 20, 2014, 4:50pm UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/3 "2014-03-20T16:50:46Z")

</div>

It seems doable.

Do you have an example for how to do this harvest using JSON ?

Thanks

---

<div class="post-metadata">

**Author:** ![jlecour](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/jlecour/32/971_2.png) [@jlecour](https://community.miniprofiler.com/u/jlecour)\
**Post date:** [March 21, 2014, 7:29am UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/4 "2014-03-21T07:29:38Z")

</div>

In the meantime, requesting the API with the `?pp=flamegraph` gives back the flamegraph HTML page for the corresponding API endpoint, witch is really useful.

---

<div class="post-metadata">

**Author:** ![eshaiju](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/eshaiju/32/872_2.png) [@eshaiju](https://community.miniprofiler.com/u/eshaiju)\
**Post date:** [March 9, 2016, 6:10am UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/5 "2016-03-09T06:10:36Z")

</div>

if rack mini profiler can’t display the results, it will collect them until it can on the next HTML page. So, the solution that I am using is to:

make the JSON request and  
then hit an HTML page of my choice.  
The results will appear, along with the most recent HTML profile.

---

<div class="post-metadata">

**Author:** ![kazhian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/kazhian/32/916_2.png) [@kazhian](https://community.miniprofiler.com/u/kazhian)\
**Post date:** [May 8, 2018, 5:18pm UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/6 "2018-05-08T17:18:46Z")

</div>

I do have the same question. After adding the gem, when I call the API, I see only my JSON data. How to see the profile data?

---

<div class="post-metadata">

**Author:** ![kazhian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/kazhian/32/916_2.png) [@kazhian](https://community.miniprofiler.com/u/kazhian)\
**Post date:** [May 8, 2018, 5:19pm UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/7 "2018-05-08T17:19:31Z")

</div>

Do you mean the HTML of the same service? What if my service doesn’t have a HTML page at all?

Thank you

---

<div class="post-metadata">

**Author:** ![kazhian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/kazhian/32/916_2.png) [@kazhian](https://community.miniprofiler.com/u/kazhian)\
**Post date:** [May 8, 2018, 5:23pm UTC](https://community.miniprofiler.com/t/how-to-profile-a-non-html-rails-4/245/8 "2018-05-08T17:23:39Z")

</div>

When I call the API from Postman, I see below header. But they are encrypted. How to decrypt them?

X-MiniProfiler-Ids →[“mr2z8e9jblj8jwvc2z0x”,“ba8z993edebbck9n9yq2”,“efh7dt8exlklhhwkf07r”,“n8al9x4ew8q65any4nmd”,“xl7djpj3hcyoy9pjurxn”,“ie7c0h9bovc9j9t7uwlj”,“frrcwq4460qzyqmy7h5m”,“ndrxyw0n4ws85izuiokl”,“yrz1u6qe4s8j02ghubmd”,“fr744fd6wf0zbsgu3apt”,“mjvs9mobimgpwejy6fwp”,“e8v8pjbcuv6w8akrs9mv”,“jdwpcb29epn4yqq4gw4y”,“3yro1leeqgebm0zcgfna”,“ljlhgselyz92d9ufuwvd”,“1sycn9a67jp8g4g96fv3”,“z46plkd77b83ihprincq”,“k70bd6u8tlv1l0qtafvk”,“5f5fy784n2oa6r084xw3”,“r8kei0qj1w0v7mhlegkt”]

X-MiniProfiler-Original-Cache-Control →max-age=0, private, must-revalidate
