{"id":19142124,"url":"https://github.com/eldoy/sbanken","last_synced_at":"2025-07-06T19:33:32.483Z","repository":{"id":57689092,"uuid":"492096284","full_name":"eldoy/sbanken","owner":"eldoy","description":"Unofficial Sbanken API library","archived":false,"fork":false,"pushed_at":"2022-12-23T22:10:57.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T04:02:24.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/eldoy.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":"2022-05-14T02:51:58.000Z","updated_at":"2022-06-04T21:48:11.000Z","dependencies_parsed_at":"2023-01-30T19:35:12.210Z","dependency_job_id":null,"html_url":"https://github.com/eldoy/sbanken","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/eldoy%2Fsbanken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fsbanken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fsbanken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fsbanken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/sbanken/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240223193,"owners_count":19767593,"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":[],"created_at":"2024-11-09T07:26:03.014Z","updated_at":"2025-02-22T19:20:57.444Z","avatar_url":"https://github.com/eldoy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SBanken API Libary\n\nUse this library to connect to the Norwegian Bank Sbanken's API's.\n\n\u0026raquo; [Swagger Documentation](https://publicapi.sbanken.no/openapi/apibeta/index.html?urls.primaryName=API%20Beta%20V2)\n\n### Install\n\n```sh\nnpm i sbanken\n```\n\n### Usage\n\n```js\n// Require lib\nconst api = require('sbanken')({\n  clientid: 'APP_CLIENT_ID',\n  secret: 'APP_SECRET'\n})\n\n// Get access token\nconst { data } = await api('token/create')\n{\n  access_token: 'TOKENSTRING',\n  expires_in: 3600,\n  token_type: 'Bearer',\n  scope: 'GW.ApiBetaCustomer'\n}\n\n// Get accounts\nconst { data } = await api('account/find')\n\n// Example response\n{\n  availableItems: 1,\n  items: [\n    {\n      accountId: 'AAABBBCCC111222333',\n      accountNumber: '97101778369',\n      ownerCustomerId: '16118855566',\n      name: 'LØNNSKONTO',\n      accountType: 'Standard account',\n      available: 132379.9,\n      balance: 136864.9,\n      creditLimit: 0\n    }\n  ]\n}\n\n// Get account info\n// 'id' is the accountId from account/find, not the actual account number\nconst { data } = await api('account/get', { id })\n\n// Get transactions\n/* account_id: string\nRequired. The accountId from account/find\n*/\n\n/* startDate: string\nOptional. The start of the query time span. Must be less than or equal to endDate, and less than or equal to the current date + 1 day. Default value is endDate -30 days. Minimum value is 2000-01-01\n*/\n\n/* endDate: string\nOptional. The end of the query time span. Must be greater than or equal to startDate, and less than or equal to the current date +1 day. Query cannot span more than 366 days. Default value is the current date.\n*/\n\n/* index: int\nOptional. The index of the first item to be retrieved. Minimum value is 0, which is the first item within the query time span. Default value is 0.\n*/\n\n/* length: int\nOptional. Return a number of items items up to this value. Minimum value is 1, maximum value is 1000. The default value is 100.\n*/\n\nconst { data } = await api('transaction/find', {\n  account_id: '93454A0332...',\n  startDate: '-30',\n  endDate: new Date(),\n  index: 0,\n  length: 100\n})\n\n// Example response\n{\n  availableItems: 8,\n  items: [\n    {\n      accountingDate: '2022-05-25T00:00:00',\n      interestDate: '2022-05-24T00:00:00',\n      otherAccountNumberSpecified: false,\n      amount: -12000,\n      text: 'Description',\n      transactionType: 'NETTGIRO',\n      transactionTypeCode: 203,\n      transactionTypeText: 'NETTGIRO',\n      isReservation: false,\n      reservationType: null,\n      source: 'Archive',\n      cardDetailsSpecified: false,\n      transactionDetailSpecified: false\n    }\n  ]\n}\n```\n\nThe `transaction/find` availableItems is the total possible matches, the items adhere to the `length` parameter.\n\nMIT Licensed. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fsbanken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Fsbanken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fsbanken/lists"}