# How to get company postcode (zip code)

**URL:** <https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442>\
**Category:** APIs & Integrations\
**Created:** [July 21, 2022, 3:02pm UTC](https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442 "2022-07-21T15:02:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpal5](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@mpal5](https://community.hubspot.com/u/mpal5)\
**Post date:** [July 21, 2022, 3:02pm UTC](https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442/1 "2022-07-21T15:02:04Z")

</div>

Hello,  
I am trying to retrieve data from HubSpot using Hubspot API for python [GitHub - HubSpot/hubspot-api-python: HubSpot API Python Client Libraries for V3 version of the API · GitHub](https://github.com/HubSpot/hubspot-api-python).  
My code is:  
_from hubspot import HubSpot_  
_from hubspot.auth.oauth import ApiException_

_api\_client = HubSpot()_

_client\_id = “#####”_  
_client\_secret = “#####”_  
_code = ‘#####’_  
_try:_  
_tokens = api\_client.auth.oauth.tokens\_api.create\_token(_  
_grant\_type=“authorization\_code”,_  
_redirect\_uri=“[https://www.example.com/auth-callback](https://www.example.com/auth-callback)”,_  
_client\_id=client\_id,_  
_client\_secret=client\_secret,_  
_code=code_  
_)_  
_except ApiException as e:_  
_print(“Exception when calling create\_token method: %s\n” % e)_  
_api\_client = HubSpot(access\_token=tokens.access\_token)_

_all\_companies = api\_client.crm.companies.get\_all()_  
_print(all\_companies)_  
However, this request returns me some info about companies. Properties field contains info:

```auto
'properties': {'createdate': '2022-04-11T09:35:55.818Z',
 'domain': 'mycompany.com',
 'hs_lastmodifieddate': '2022-04-11T09:38:27.998Z',
 'hs_object_id': '1234567',
 'name': 'My Company'},

```

I need address and postcode for the company. In my account this info is available, I see that this info comes from HubSpot Insights database.  
Could you please suggest me how to get company address in my case?  
Many thanks!

---

<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:** [July 22, 2022, 4:49pm UTC](https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442/2 "2022-07-22T16:49:51Z")

</div>

Hi, @mpal5 👋 Thanks for reaching out. Hey @taran42, do you have any Python expertise you can share with @mpal5?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![taran42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/taran42/32/105524_2.png) [@taran42](https://community.hubspot.com/u/taran42)\
**Post date:** [July 22, 2022, 5:37pm UTC](https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442/3 "2022-07-22T17:37:08Z")

</div>

@mpal5 I’m less familiar with v3 as v2, but I think they work the same way as in you need to call the properties you are looking for. From the v3 GitHub documentation:

```lia-code-sample
try:
 simple_public_object_input = SimplePublicObjectInput(
 properties={"email": "email@example.com"}
 )

```

So you need to call the address and postcode properties in place of email.

---

<div class="post-metadata">

**Author:** ![mpal5](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@mpal5](https://community.hubspot.com/u/mpal5)\
**Post date:** [July 25, 2022, 12:41pm UTC](https://community.hubspot.com/t/how-to-get-company-postcode-zip-code/61442/4 "2022-07-25T12:41:00Z")

</div>

Thank you @taran42 !  
It works for me in this way:  
all\_companies = api\_client.crm.companies.get\_all(properties=“city”,“state”,“country”,“zip”,“domain”, “industry”, “name”])
