{"id":19481554,"url":"https://github.com/blackgard/amocrm-api","last_synced_at":"2026-06-16T15:31:41.440Z","repository":{"id":220772108,"uuid":"374847686","full_name":"Blackgard/amocrm-api","owner":"Blackgard","description":"AmoCRM API v4 connector python","archived":false,"fork":false,"pushed_at":"2021-06-10T02:06:21.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-25T17:37:18.024Z","etag":null,"topics":["amocrm","api","api-amocrm","api-wrapper","python"],"latest_commit_sha":null,"homepage":"","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/Blackgard.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-08T01:40:16.000Z","updated_at":"2024-11-27T14:29:35.000Z","dependencies_parsed_at":"2024-02-04T08:34:39.008Z","dependency_job_id":null,"html_url":"https://github.com/Blackgard/amocrm-api","commit_stats":null,"previous_names":["blackgard/amocrm-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blackgard/amocrm-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Famocrm-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Famocrm-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Famocrm-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Famocrm-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blackgard","download_url":"https://codeload.github.com/Blackgard/amocrm-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Famocrm-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34412786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["amocrm","api","api-amocrm","api-wrapper","python"],"created_at":"2024-11-10T20:05:31.659Z","updated_at":"2026-06-16T15:31:41.424Z","avatar_url":"https://github.com/Blackgard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003eAmoCRM API v4 Libary\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e Connector to AmoCRM API v4 (\u003ca href=\"https://www.amocrm.ru/\"\u003ehttps://www.amocrm.ru/\u003c/a\u003e)\n    \u003cbr\u003e\n\u003c/p\u003e\n\n## 📚 Table of Contents\n\n- [About](#about)\n- [Getting Started](#getting_started)\n- [Available models](#available_models)\n- [Usage](#usage)\n\n## 💬 About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nConnector for connecting via api to your AmoCRM system. Allows you to easily receive data on deals and contacts, as well as update them.\n\n## 🧵 Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n### Pip or poetry\n\nThe project uses [Poetry](https://python-poetry.org/) instead of pip. But if you do not want to install the [Poetry](https://python-poetry.org/), for this case, create a file \"requirements.txt\".\n\n### Init\n\nTo get started, you need to import the main class AmoCRM and init class AmoCRMInit. \n\n```python\nfrom amocrm.v4.amoCRM import AmoCRM, AmoCRMInit\n```\n\nThen you need to create a model object AmoCRMInit and set settings value. If you want to use environment variables, then the file [.env.example](https://github.com/Blackgard/amocrm-api/blob/master/.env.example) is prepared for this.\n\n```python\ninit_amocrm_data = AmoCRMInit(\n    connect_email=\"test@test.ru\",\n    connect_domain=\"amocrm-api\", \n\n    connect_id=\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n    connect_secret_key=\"xxXXXxxXxxXXx\",\n    redirect_uri=\"https://xxxxxxxxxx.xxx\",\n\n    init_code=\"xХxXxxXxxXXxХХХХxxХХxxХxХxХХххххХxxXXXxxXxxXXx\"\n)\n```\n\nTo debug the project, set the debug variable to true\n\n```python\ninit_amocrm_data.debug = True\n```\n\nAnd now you can transfer the settings to the main model of the AmoCRM class.\n\n```python\namocrm = AmoCRM(init_amocrm_data)\n```\n\n## 📌 Available models \u003ca name=\"available_models\"\u003e\u003c/a\u003e\n\nSo far, only two AmoCRM models are available for work:\n\n1. Leads \n2. Contacts \n\nFurther, their list will be replenished.\n\n## 🧰 Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n### GET data\n\nTo get unprocessed data, you need to use the get method.\n\n```python\n\u003e\u003e\u003e response = amocrm.get(AmoCRM.ACTION.LEADS)\n\u003e\u003e\u003e response\nAmoCRMFuncResponce(status=True, data=AmoResponceGet({'_page' : 1, '_links' : {'self': {'href': '', ...}}))\n```\n\nIf you need to get only the data part, the get_date method can help you.\n\n```python\n\u003e\u003e\u003e response = amocrm.get_data(AmoCRM.ACTION.LEADS)\n\u003e\u003e\u003e response\nAmoCRMFuncResponce(status=True, data=[Leads(id=12653276, name='Name', price=0, ... ), ...])\n```\n\nYou can also get data in the form of a Dataframe ([pandas](https://pandas.pydata.org/)). \n\n```python\n\u003e\u003e\u003e response = amocrm.get_data_df(AmoCRM.ACTION.LEADS)\n\u003e\u003e\u003e response\nAmoCRMFuncResponce(status=True, data=Dataframe(columns=[id, name, price, group_id, ...], data=[...]))\n```\n\nThis method has an additional boolean parameter \"get_all_data\" (default False), which allows you to go through all transactions in one function call and collect all this in Dataframe.\n\n```python\n\u003e\u003e\u003e response = amocrm.get_data_df(AmoCRM.ACTION.LEADS, get_all_data=True)\n```\n\nAlso, to obtain specific data, you need to apply the AMoCRM filters. For these purposes, there is a separate class FilterAmoCRM.\n\n```python\n\u003e\u003e\u003e from amocrm.v4.amoCRM import FilterAmoCRM\n\u003e\u003e\u003e amocrm_filters = FilterAmoCRM(FilterAmoCRM.ACTIONS.LAST_DAY).get_filters()\n\u003e\u003e\u003e amocrm_filters\n{'contacts': 'limit=10\u0026filter[created_at][from]=1623170867\u0026filter[created_at][to]=...', 'leads': '...'}\n\n\u003e\u003e\u003e amocrm.get(AmoCRM.ACTION.LEADS, filters=amocrm_filters.get(FilterAmoCRM.TABLE.LEADS))\n...\n```\n\n### For work with POST and PATCH methods\n\nHow work with POST and PATCH data, you need use special models:\n\n* AmoRequestPostLeads - How post new leads\n* AmoRequestPostContacts - How post new contacts \n* AmoRequestPatchLeads - How update leads\n* AmoRequestPatchContacts - How update contacts\n\n\nImport:\n```python\n\u003e\u003e\u003e from amocrm.v4.amoCRM import AmoRequestPostLeads, AmoRequestPostContacts, \\\n                                 AmoRequestPatchLeads, AmoRequestPatchContacts\n```\n\nAllow fields methods see [here](https://github.com/Blackgard/amocrm-api/blob/master/amocrm/v4/models/amoCRM_M.py)\n\n### POST data\n\nTo create an object in AmoCRM, you need to use the post method.\n\n```python\n\u003e\u003e\u003e response = amocrm.post(AmoCRM.ACTION.LEADS, data=[AmoRequestPostLeads(name=\"test\", price=100.0, ...), ...])\n\u003e\u003e\u003e response\nAmoCRMFuncResponce(status=True, data=AmoResponcePost(links=..., embedded=DataLeadsPost(leads=[LeadsPost(id=1, name=\"test\"))))]))\n```\n\nTo use the complex addition of deals, you need to call the action \"LEADS_COMPLEX\". This method accepts an array with objects and, if necessary, splits it into packages of size {max_count}.\n\n```python\n\u003e\u003e\u003e amocrm.post(AmoCRM.ACTION.LEADS_COMPLEX, data=[...(\u003e 100)], max_count=50)\n1 step: Send data[0:49]\n2 step: Send data[50:99]\n```\n\n### PATCH data\n\nTo update the model data, you must use the patch method. Required parameter is the ID of the object that needs to be updated.\n\n```python\n\u003e\u003e\u003e response = amocrm.patch(AmoCRM.ACTION.LEADS, data=[AmoRequestPatchLeads(id=1, name=\"test\", price=100.0, ...), ...])\n\u003e\u003e\u003e response\nAmoCRMFuncResponce(status=True, data=AmoResponcePatch(links=..., embedded=DataLeadsPatch(leads=[LeadsPatch(id=1, name=\"test\"))))]))\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackgard%2Famocrm-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackgard%2Famocrm-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackgard%2Famocrm-api/lists"}