# Invalid JSON response for /library/sections/5/all

**URL:** <https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [July 8, 2014, 12:41am UTC](https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331 "2014-07-08T00:41:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukeChannings](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/lukechannings/32/83530_2.png) [@LukeChannings](https://forums.plex.tv/u/LukeChannings)\
**Post date:** [July 8, 2014, 12:41am UTC](https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331/1 "2014-07-08T00:41:32Z")

</div>

Hi,

&nbsp;

I'm trying to get data for my music collection and I can't parse the JSON returned by&nbsp;/library/sections/5/all (where 5 is the id of my music collection).

&nbsp;

I'm on PMS version 0.9.9.12, is there anything I can do about this?

---

<div class="post-metadata">

**Author:** ![LukeChannings](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/lukechannings/32/83530_2.png) [@LukeChannings](https://forums.plex.tv/u/LukeChannings)\
**Post date:** [July 8, 2014, 10:16pm UTC](https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331/2 "2014-07-08T22:16:58Z")

</div>

The issue was caused by a missing comma in a list of objects, Given that the construct } { is never valid JSON I just search and replace:&nbsp;JSON.parse(xhr.response.replace(/}[\s]\*{/g, '}, {')), which fixes the issue.

It's disappointing that the JSON output of Plex isn't reliable though.

---

<div class="post-metadata">

**Author:** ![atrus](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atrus/32/31_2.png) [@atrus](https://forums.plex.tv/u/atrus)\
**Post date:** [July 8, 2014, 11:16pm UTC](https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331/3 "2014-07-08T23:16:57Z")

</div>

> The issue was caused by a missing comma in a list of objects, Given that the construct } { is never valid JSON I just search and replace:&nbsp;JSON.parse(xhr.response.replace(/}[\s]\*{/g, '}, {')), which fixes the issue.
> 
> It's disappointing that the JSON output of Plex isn't reliable though.

Thanks for reporting! It is a known issue that is on the loooong to-do list.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 2:26am UTC](https://forums.plex.tv/t/invalid-json-response-for-library-sections-5-all/70331/4 "2019-12-21T02:26:27Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
