{"id":21195682,"url":"https://github.com/margato/fundamentus-unofficial-api","last_synced_at":"2025-07-10T04:30:37.081Z","repository":{"id":40775388,"uuid":"254948347","full_name":"margato/fundamentus-unofficial-api","owner":"margato","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T03:12:05.000Z","size":1738,"stargazers_count":31,"open_issues_count":15,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-07T10:54:36.505Z","etag":null,"topics":["acoes","api","b3","bovespa","cotacao","fundamentalistas","fundamentus","indicadores"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fundamentus-unofficial-api","language":"JavaScript","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/margato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-11T20:20:02.000Z","updated_at":"2024-03-29T04:16:43.000Z","dependencies_parsed_at":"2023-02-05T04:45:54.903Z","dependency_job_id":null,"html_url":"https://github.com/margato/fundamentus-unofficial-api","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/margato%2Ffundamentus-unofficial-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margato%2Ffundamentus-unofficial-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margato%2Ffundamentus-unofficial-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margato%2Ffundamentus-unofficial-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/margato","download_url":"https://codeload.github.com/margato/fundamentus-unofficial-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225618434,"owners_count":17497519,"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":["acoes","api","b3","bovespa","cotacao","fundamentalistas","fundamentus","indicadores"],"created_at":"2024-11-20T19:30:08.033Z","updated_at":"2024-11-20T19:30:10.022Z","avatar_url":"https://github.com/margato.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fundamentus Unofficial API\n\n[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)\n\nThis module provides an api to get data from Brazilian stock shares.\n\nThe truth of source is Fundamentus, a website that provides financial and fundamentalist information about companies listed on the Bovespa.\n\n\n## Content\n- [Fetching details](#fetching-details-about-share)\n- [Fetching quotation history](#fetching-quotation-history)\n- [Fetching earnings history](#fetching-earnings-history)\n\n## Installation\n\n```bash\n$ npm install fundamentus-unofficial-api --save\n```\n\n## Usage\n\n\n### Importing\n\n```js\nconst FundamentusAPI = require('fundamentus-unofficial-api') // CommonJS\n// or\nimport FundamentusAPI from 'fundamentus-unofficial-api' // ESM\n```\n\n\n### Fetching details about share\n\n```js\nconst share = await FundamentusAPI.fetch('petr3')\n```\n\n#### Output\n\n- All fields are parsed to its correct data type\n\t- *i.e.* '\"1,78%\" =\u003e 0.0178\n- If a field is `null`, it means there is no data available from Fundamentus\n\n\u003cdetails\u003e\n  \u003csummary\u003econsole.log(share)\u003c/summary\u003e\n  \n```js\n{\n  ano2015: -0.0455,\n  ano2016: 0.9738,\n  ano2017: -0.0018,\n  ano2018: 0.5154,\n  ano2019: 0.2774,\n  ano2020: -0.3891,\n  ativo: 926011000000,\n  ativoCirculante: 112101000000,\n  cotacao: 19.55,\n  cresRec5A: 0.009,\n  dataUltCot: '08/05/2020',\n  dia: 0.0683,\n  disponibilidades: 33294000000,\n  divBrPorPatrim: 1.19,\n  divBruta: 351161000000,\n  divLiquida: 317867000000,\n  divYield: 0.026,\n  ebit: 95991000000,\n  ebitPorAtivo: 0.104,\n  ebitUltimos3Meses: 28649000000,\n  empresa: 'PETROBRAS ON',\n  evPorEbit: 5.97,\n  evPorEbitda: 3.6,\n  giroAtivos: 0.33,\n  liquidezCorr: 0.97,\n  lpa: 3.08,\n  lucroLiquido: 40137000000,\n  lucroLiquidoUltimos3Meses: 8153000000,\n  margBruta: 0.404,\n  margEbit: 0.318,\n  margLiquida: 0.136,\n  max52Sem: 33.28,\n  mes: 0.0483,\n  min52Sem: 11.05,\n  nroAcoes: 13044500000,\n  pPorAtivCircLiq: -0.5,\n  pPorAtivos: 0.28,\n  pPorCapGiro: -63.03,\n  pPorEbit: 2.66,\n  pPorL: 6.35,\n  pPorVp: 0.86,\n  papel: 'PETR3',\n  patrimLiq: 295541000000,\n  psr: 0.84,\n  receitaLiquida: 302245000000,\n  receitaLiquidaUltimos3Meses: 72628000000,\n  roe: 0.136,\n  roic: 0.11,\n  setor: 'Petróleo, Gás e Biocombustíveis',\n  subsetor: 'Exploração e/ou Refino e Distribuição',      \n  tipo: 'ON',\n  ultBalancoProcessado: '31/12/2019',\n  ultimos12Meses: -0.3437,\n  ultimos30Dias: 0.1171,\n  valorDaFirma: 572887000000,\n  valorDeMercado: 255020000000,\n  volMed2M: 607192000,\n  vpa: 22.66\n}\n```\n  \n\u003c/details\u003e\n\n### Fetching quotation history\n\n```js\nconst quotationHistory = await FundamentusAPI.fetchQuotationHistory('petr3')\n```\n\n#### Output\n\n```js\n// console.log(history)\nQuotationHistory {\n  share: 'PETR3',\n  history: [\n    { date: '2020-04-09', quotation: 16.86 },\n    ...\n  ]\n}\n```\n\n#### Methods\n`fetchQuotationHistory` returns a `QuotationHistory` instance which we can manipulate to get only a specific range of timeline or quotation value using the following methods:\n- last\n- minDate\n- maxDate\n- minQuotation\n- maxQuotation\n\n*Examples*\n\n```js\nconst quotationHistory = await FundamentusAPI.fetchQuotationHistory('petr3')\n\n// Returns the history range which the quotation value was, at least, R$11.43 since January 1st, 2020\nquotationHistory.minQuotation(11.43).minDate('2020-01-01')\n```\n\n```js\nconst quotationHistory = await FundamentusAPI.fetchQuotationHistory('petr3')\n\n// Returns the history in the last 10 days\nquotationHistory.last(10)\n```\n### Fetching earnings history\n\n```js\nconst earningsHistory = await FundamentusAPI.fetchEarningsHistory('petr3')\n```\n\n#### Output\n\n```js\n// console.log(history)\nEarningsHistory {\n  share: 'PETR3',\n  history: [\n    { date: '2008-04-04', value: 0.05, type: 'DIVIDENDO', perShare: 1 },\n    ...\n  ]\n}\n```\n\n#### Methods\n`fetchEarningsHistory` returns a `EarningsHistory` instance which we can manipulate to get only a specific range of timeline, value or by type using the following methods:\n- minDate\n- maxDate\n- minValue\n- maxValue\n- filterByType\n\n*Examples*\n\n```js\nconst earningsHistory = await FundamentusAPI.fetchEarningsHistory('petr3')\n\n// Returns all the earnings of 2019\nearningsHistory.minDate('2019-01-01').maxDate('2019-12-31')\n```\n\n```js\nconst earningsHistory = await FundamentusAPI.fetchEarningsHistory('petr3')\n\n// Returns earnings by dividends with min value of 0.5\nearningsHistory.filterByType('DIVIDENDO').minValue(0.5)\n```\n\n## Getting help\n\nIf you need help, want to make a suggestion or encounter a bug, please contact me:\n\u003cbr/\u003e\nhttps://github.com/margato/fundamentus-unofficial-api/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargato%2Ffundamentus-unofficial-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmargato%2Ffundamentus-unofficial-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargato%2Ffundamentus-unofficial-api/lists"}