# API issue with oapi.get\_structures\_with\_sets?

**URL:** <https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357>\
**Category:** Technical\
**Tags:** api, allensdk\
**Created:** [May 25, 2023, 4:25pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357 "2023-05-25T16:25:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pderdeyn](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/pderdeyn/32/812_2.png) [@pderdeyn](https://community.brain-map.org/u/pderdeyn)\
**Post date:** [May 25, 2023, 4:25pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/1 "2023-05-25T16:25:56Z")

</div>

I’m having an issue running some code from the AllenSDK ([JSONDecodeError when running oapi.get\_structures\_with\_sets([1]) · Issue #2684 · AllenInstitute/AllenSDK · GitHub](https://github.com/AllenInstitute/AllenSDK/issues/2684)). I get a JSONDecodeError when trying to run the following block of code

```auto
from allensdk.api.queries.ontologies_api import OntologiesApi
oapi = OntologiesApi()
structure_graph = oapi.get_structures_with_sets([1])

```

I suspect it might be an API issue rather than an SDK issue, as I’ve had this code work perfectly fine in the past. Anyone else having this issue?

---

<div class="post-metadata">

**Author:** ![pderdeyn](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/pderdeyn/32/812_2.png) [@pderdeyn](https://community.brain-map.org/u/pderdeyn)\
**Post date:** [May 26, 2023, 5:19pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/2 "2023-05-26T17:19:42Z")

</div>

It’s working now today. Not sure what was causing the issue, though

---

<div class="post-metadata">

**Author:** ![Susan.Sunkin](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Susan.Sunkin](https://community.brain-map.org/u/Susan.Sunkin)\
**Post date:** [June 5, 2023, 8:14pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/3 "2023-06-05T20:14:45Z")

</div>

Thank you for letting us know that it is working now.

---

<div class="post-metadata">

**Author:** ![robertooooo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/robertooooo/32/243_2.png) [@robertooooo](https://community.brain-map.org/u/robertooooo)\
**Post date:** [July 14, 2024, 3:58pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/4 "2024-07-14T15:58:46Z")

</div>

Hi, I get the same cryptic error all of a sudden: `simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`

---

<div class="post-metadata">

**Author:** ![pderdeyn](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/pderdeyn/32/812_2.png) [@pderdeyn](https://community.brain-map.org/u/pderdeyn)\
**Post date:** [July 19, 2024, 8:03pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/5 "2024-07-19T20:03:00Z")

</div>

Are you still experiencing this issue? I just tried the 3 lines of code I shared in the original post and they are working today, at least. My guess is this is a server-side issue that comes up from time to time

---

<div class="post-metadata">

**Author:** ![robertooooo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/robertooooo/32/243_2.png) [@robertooooo](https://community.brain-map.org/u/robertooooo)\
**Post date:** [July 19, 2024, 8:15pm UTC](https://community.brain-map.org/t/api-issue-with-oapi-get-structures-with-sets/2357/6 "2024-07-19T20:15:20Z")

</div>

Solved the day after. Agree with your explanation.
