{"id":19640207,"url":"https://github.com/gearplug/hubspot-python","last_synced_at":"2025-04-28T11:31:04.707Z","repository":{"id":45884040,"uuid":"114394227","full_name":"GearPlug/hubspot-python","owner":"GearPlug","description":"HubSpot API wrapper written in Python.","archived":false,"fork":false,"pushed_at":"2023-03-27T21:29:34.000Z","size":36,"stargazers_count":9,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T08:25:48.601Z","etag":null,"topics":["api","hubspot","library","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GearPlug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-15T17:11:57.000Z","updated_at":"2022-05-16T09:56:57.000Z","dependencies_parsed_at":"2023-01-21T22:00:16.076Z","dependency_job_id":null,"html_url":"https://github.com/GearPlug/hubspot-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fhubspot-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fhubspot-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fhubspot-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fhubspot-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GearPlug","download_url":"https://codeload.github.com/GearPlug/hubspot-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251304797,"owners_count":21567941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hubspot","library","wrapper"],"created_at":"2024-11-11T14:05:03.579Z","updated_at":"2025-04-28T11:31:04.391Z","avatar_url":"https://github.com/GearPlug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hubspot-python\nHubSpot API wrapper written in Python.\n\n## Installing\n\n```\npip install hubspot-python\n```\n\n## Requirements\n\n```\n- requests\n```\n\n## Usage\n\n#### Client instantiation\n```\nfrom hubspot.client import Client\nclient = Client(APP_ID, HAPIKEY, CLIENT_ID, CLIENT_SECRET)\n```\n\n### Companies\n#### Get all companies\n```\nresponse = client.companies.get_companies(data)\n```\n\n#### Create a Company\n```\ndata = {\n    \"name\": \"A company name\",\n    \"description\": \"A company description\"\n}\nresponse = client.companies.create_company(data)\n```\n\n#### Delete a Company\n```\nresponse = client.companies.delete_company(COMPANY_ID)\n```\n\n#### Get Recently Created Companies\n```\nresponse = client.companies.get_recently_created_companies()\n```\n\n#### Get a Company\n```\nresponse = client.companies.get_company(COMPANY_ID)\n```\n\n### Contact Lists\n#### Get contact lists\n```\nresponse = client.contact_lists.get_contact_lists()\n```\n\n#### Create a new contact list\n```\ndata = {\n    \"name\": \"tweeters\",\n    \"dynamic\": true,\n    \"portalId\": 62515,\n    \"filters\": \n    [\n        [{\n            \"operator\": \"EQ\",\n            \"value\": \"@hubspot\",\n            \"property\": \"twitterhandle\",\n            \"type\": \"string\"\n        }]\n    ]\n}\nresponse = client.contact_lists.create_contact_list(data)\n```\n\n#### Delete a contact list\n```\nresponse = client.contact_lists.delete_contact_list(CONTACT_LIST_ID)\n```\n\n#### Get recently added contacts from a list\n```\nresponse = client.contact_lists.get_recently_added_contacts_in_a_list()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.contact_lists.get_contact_list(CONTACT_LIST_ID)\n```\n\n#### Add existing contacts to a list\n```\ndata = {\n  \"vids\": [\n    3057124,\n\t5524274\n  ],\n  \"emails\": [\n    \"testingapis@hubspot.com\"\n  ]\n}\nresponse = client.contact_lists.add_contact_to_list(CONTACT_LIST_ID, data)\n```\n\n### Contacts\n#### Get all contacts\n```\nresponse = client.contacts.get_contacts()\n```\n\n#### Create a new contact\n```\ndata = {\n    \"email\": \"testingapis@hubspot.com\",\n    \"firstname\": \"Adrian\",\n    \"lastname\": \"Mott\",\n    \"website\": \"http://hubspot.com\",\n    \"company\": \"HubSpot\",\n    \"phone\": \"555-122-2323\",\n    \"address\": \"25 First Street\",\n    \"city\": \"Cambridge\",\n    \"state\": \"MA\",\n    \"zip\": \"02139\",\n}\nresponse = client.contacts.create_contact(data)\n```\n\n#### Delete a contact\n```\nresponse = client.contacts.delete_contact(CONTACT_ID)\n```\n\n#### Get recently created contacts\n```\nresponse = client.contacts.get_recently_created_contacts()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.contacts.get_contact(CONTACT_ID)\n```\n\n### Deals\n#### Get all deals\n```\nresponse = client.deals.get_deals()\n```\n\n#### Create a Deal\n```\ndata = {\n    \"dealname\": \"Tim's Newer Deal\",\n    \"dealstage\": \"appointmentscheduled\",\n    \"pipeline\": \"default\",\n    \"hubspot_owner_id\": \"24\",\n    \"closedate\": 1409443200000,\n    \"amount\": \"60000\",\n    \"dealtype\": \"newbusiness\",\n}\nresponse = client.deals.create_deal(data)\n```\n\n#### Delete a Deal\n```\nresponse = client.deals.delete_deal(DEAL_ID)\n```\n\n#### Get Recently Created Deals\n```\nresponse = client.deals.get_recently_created_deals()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.deals.get_deal(DEAL_ID)\n```\n\n### Fields (Properties)\n#### Get all fields\n```\nresponse = client.fields.get_fields(MODULE)\n```\n\n### Integrations\n#### Get all fields\n```\nresponse = client.integrations.get_account_details()\n```\n\n#### Get all fields\n```\nresponse = client.integrations.get_daily_api_usage()\n```\n\n### Webhooks\n#### Viewing Settings\n```\nresponse = client.webhooks.get_settings()\n```\n\n#### Updating Settings\n```\ndata = {\n    \"webhookUrl\": \"https://testing.com/webhook-modified\", \n    \"maxConcurrentRequests\": 25\n}\n\nresponse = client.webhooks.update_settings(data)\n```\n\n#### Get Subscriptions\n```\nresponse = client.webhooks.get_subscriptions()\n```\n\n#### Create a New Subscription\n```\ndata = { \n    \"subscriptionDetails\" : {\n        \"subscriptionType\" : \"company.propertyChange\", \n        \"propertyName\" : \"companyname\" \n    }, \n    \"enabled\": False\n}\n\nresponse = client.webhooks.create_subscription(data)\n```\n\n#### Update a Subscription\n```\ndata = { \n    \"enabled\": False\n}\n\nresponse = client.webhooks.create_subscription(SUBSCRIPTION_ID, data)\n```\n\n#### Delete a Subscription\n```\nresponse = client.webhooks.delete_subscription(SUBSCRIPTION_ID)\n```\n\n### Workflows\n#### Get workflows\n```\nresponse = client.workflows.get_workflows()\n```\n\n#### Get workflow\n```\nresponse = client.workflows.get_workflow(WORKFLOW_ID)\n```\n\n#### Create a workflow\n```\ndata = {\n    \"name\": \"Test Workflow\",\n    \"type\": \"DRIP_DELAY\",\n    \"onlyEnrollsManually\": true,\n    \"actions\": [\n        {\n            \"type\": \"DELAY\",\n            \"delayMillis\": 3600000\n        },\n        {\n            \"newValue\": \"HubSpot\",\n            \"propertyName\": \"company\",\n            \"type\": \"SET_CONTACT_PROPERTY\"\n        },\n        {\n            \"type\": \"WEBHOOK\",\n            \"url\": \"https://www.myintegration.com/webhook.php\",\n            \"method\": \"POST\",\n            \"authCreds\": {\n                \"user\": \"user\",\n                \"password\": \"password\"\n            }\n        }\n    ]\n}\nresponse = client.workflows.create_workflow(data)\n```\n\n#### Delete a Deal\n```\nresponse = client.workflows.delete_workflow(WORKFLOW_ID)\n```\n\n#### Enroll a contact into a workflow\n```\nresponse = client.workflows.enroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)\n```\n\n#### Unenroll a contact from a workflow\n```\nresponse = client.workflows.unenroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fhubspot-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgearplug%2Fhubspot-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fhubspot-python/lists"}