# Is Not JSON serializable (Python query)

**URL:** <https://community.hubspot.com/t/is-not-json-serializable-python-query/95055>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [November 29, 2023, 5:16pm UTC](https://community.hubspot.com/t/is-not-json-serializable-python-query/95055 "2023-11-29T17:16:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TB86](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@TB86](https://community.hubspot.com/u/TB86)\
**Post date:** [November 29, 2023, 5:16pm UTC](https://community.hubspot.com/t/is-not-json-serializable-python-query/95055/1 "2023-11-29T17:16:53Z")

</div>

Hi I’m trying to retrieve deal information via the following Python code:

import hubspot

import requests

import json

from pprint import pprint

from hubspot.crm.deals import PublicObjectSearchRequest, ApiException

api\_client = hubspot.Client.create(access\_token=“\*\*\*”)

public\_object\_search\_request = PublicObjectSearchRequest(

filter\_groups=[

{

“filters”: [

{

“value”: “Enquiry”,

“propertyName”: “status”,

“operator”: “EQ”

}

]

}

], properties=[“last\_name”, “status”, “object\_id”], limit=100

)

api\_response = api\_client.crm.deals.search\_api.do\_search(public\_object\_search\_request=public\_object\_search\_request)

print(json.dumps(api\_response, indent=4))

When executing I’m getting the following error:

TypeError: Object of type CollectionResponseWithTotalSimplePublicObjectForwardPaging is not JSON serializable

Anyone with any advice will be most helpful

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 1, 2023, 8:02pm UTC](https://community.hubspot.com/t/is-not-json-serializable-python-query/95055/2 "2023-12-01T20:02:05Z")

</div>

Hi, @TB86 👋 Welcome to our community! Were you able to get this resolved?

Best,

Jaycee
