Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Agicap/Agicap_Get_banks_accounts_from_company.ipynb
2973 views
Kernel: Python 3

Agicap.png

Agicap - Get banks accounts from company

Give Feedback | Bug report

Tags: #agicap #bankaccount #company #finance #data #api

Last update: 2023-07-12 (Created: 2023-07-12)

Description: This notebook will show how to get bank account from a company using Agicap API. It is usefull for organizations to quickly get the bank account of a company.

Input

Import libraries

import requests import naas import pandas as pd

Setup Variables

  • token: Get your Agicap Bearer Token by inspecting your page

  • company_id: Company ID on Agicap, it must matched an id extracted from "Agicap_List_companies.ipynb" template.

token = naas.secret.get("AGICAP_BEARER_TOKEN") or "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX" company_id = "xxxx"

Model

Get all banks accounts from company

url = "https://app.agicap.com/api/banque/GetAll" # Headers headers = { "Accept": "application/json, text/plain, */*", "Authorization": f"Bearer {token}", "Entrepriseid": company_id } # Request res = requests.get(url, headers=headers) res.raise_for_status res

Transform json to dataframe

result = [] if res.status_code == 200: result = res.json().get("Result") df = pd.DataFrame(result) df.head(1)

Output

Display result

print("Accounts fetched:", len(df)) df