{"id":20826960,"url":"https://github.com/crizmo/xlsx-mongo-api","last_synced_at":"2026-05-19T05:32:18.781Z","repository":{"id":180436794,"uuid":"664763861","full_name":"crizmo/xlsx-mongo-api","owner":"crizmo","description":"Import / Add data from xlsx file to mongodb ","archived":false,"fork":false,"pushed_at":"2023-07-12T04:45:35.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T04:34:07.005Z","etag":null,"topics":["add","api","import","mongo","xlsx"],"latest_commit_sha":null,"homepage":"https://xlsxmongoapi.kurizu.repl.co/","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/crizmo.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,"publiccode":null,"codemeta":null}},"created_at":"2023-07-10T17:36:18.000Z","updated_at":"2023-07-18T09:39:48.000Z","dependencies_parsed_at":"2023-07-16T06:00:32.795Z","dependency_job_id":null,"html_url":"https://github.com/crizmo/xlsx-mongo-api","commit_stats":null,"previous_names":["crizmo/xlsx-mongo-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crizmo/xlsx-mongo-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crizmo","download_url":"https://codeload.github.com/crizmo/xlsx-mongo-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271739904,"owners_count":24812636,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"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":["add","api","import","mongo","xlsx"],"created_at":"2024-11-17T23:10:38.972Z","updated_at":"2025-10-24T17:44:25.355Z","avatar_url":"https://github.com/crizmo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003exlsx-mongo-api\u003c/h1\u003e\n  \u003cp\u003eA RESTful API for importing and adding data from XLSX files to MongoDB\u003c/p\u003e\n  \u003ca href=\"https://github.com/crizmo/xlsx-mongo-api\"\u003e\u003cimg src=\"https://img.shields.io/github/license/crizmo/xlsx-mongo-api?style=for-the-badge\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/crizmo/xlsx-mongo-api\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/crizmo/xlsx-mongo-api?style=for-the-badge\" alt=\"Stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/crizmo/xlsx-mongo-api\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/crizmo/xlsx-mongo-api?style=for-the-badge\" alt=\"Issues\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## About The Project\n`xlsx-mongo-api` is a RESTful API built with Node.js and Express that allows you to import and add data from XLSX files to MongoDB. It serves as a convenient interface for utilizing the `xlsx-mongo` package.\n\n## Features\n- Import data from XLSX file to MongoDB\n- Add data from XLSX file to existing MongoDB collection\n- Dynamic generation of MongoDB schema based on XLSX file headers\n- Configurable MongoDB connection URL and collection name\n- Support for handling large XLSX files\n\n## Getting Started\n### Prerequisites\n- Node.js and npm installed on your machine\n- MongoDB server up and running\n- XLSX files with data to import\n\n### API Endpoints\n\n1. POST /import\n  - Description: Import data from an XLSX file to MongoDB\n  - Request Parameters: \u003cbr\u003e\n      1. file (multipart/form-data): XLSX file to import \u003cbr\u003e\n      2. collectionName (optional): Name of the collection to import/add the data to.\u003cbr\u003e If not provided, it will use the filename as the collection name.\u003cbr\u003e\u003cbr\u003e\n  - Response: JSON response with a success message or error message\n\n2. POST /add\n  - Description: Add data from an XLSX file to an existing MongoDB collection\n  - Request Parameters: \u003cbr\u003e\n      1. file (multipart/form-data): XLSX file to import \u003cbr\u003e\n      2. collectionName (optional): Name of the collection to import/add the data to.\u003cbr\u003e If not provided, it will use the filename as the collection name.\u003cbr\u003e\u003cbr\u003e\n  - Response: JSON response with a success message or error message\n\n### Usage\n1. Start the server by running npm start.\n\n2. Send a POST request to https://xlsxmongoapi.kurizu.repl.co/import with the following parameters:\n\n  1. file: The XLSX file to import.\n  2. collectionName (optional): The name of the collection to import/add the data to.\u003cbr\u003e If not provided, it will use the filename as the collection name.\n\n3. Create a `.env` file in the root directory of the project and add the following environment variables:\n```shell\n   MONGO_URL=\u003cyour-mongodb-connection-url\u003e\n   MONGO_COLLECTION=\u003cyour-mongodb-collection-name\u003e\n```\n\nExample using Axios:\n\n```javascript\nconst axios = require('axios');\nconst FormData = require('form-data');\nconst fs = require('fs');\n\nconst path = require('path');\nconst filePath = path.join('Test.xlsx');\n\nrequire('dotenv').config();\n\n// Import data from XLSX file to MongoDB\nconst importFile = async () =\u003e {\n  try {\n    const formData = new FormData();\n    formData.append('file', fs.createReadStream('Test.xlsx'));\n    formData.append('mongoURL', process.env.MONGO_URL);\n    formData.append('collectionName', process.env.MONGO_COLLECTION);\n\n    const response = await axios.post('https://xlsxmongoapi.kurizu.repl.co/import', formData, {\n      headers: formData.getHeaders(),\n    });\n\n    console.log(response.data);\n  } catch (error) {\n    console.error(error.response.data);\n  }\n};\n\nimportFile();\n\n// Add data from XLSX file to existing MongoDB collection\nconst addData = async () =\u003e {\n  try {\n    const formData = new FormData();\n    formData.append('file', fs.createReadStream('Test.xlsx'));\n    formData.append('path', filePath);\n    formData.append('collectionName', 'test2');\n    formData.append('mongoURL', process.env.MONGO_URL);\n\n    const response = await axios.post('https://xlsxmongoapi.kurizu.repl.co/add', formData, {\n      headers: formData.getHeaders(),\n    });\n\n    console.log(response.data);\n  } catch (error) {\n    console.error(error.response.data);\n  }\n};\n\naddData();\n```\n\nExample using RapidAPI:\n\n```javascript\nconst axios = require('axios');\nconst FormData = require('form-data');\nconst fs = require('fs');\n\nconst path = require('path');\nconst filePath = path.join('Test.xlsx');\n\nrequire('dotenv').config();\n\n// Import data from XLSX file to MongoDB\nconst importFile = async () =\u003e {\n  try {\n    const formData = new FormData();\n    formData.append('file', fs.createReadStream('Test.xlsx'));\n    formData.append('mongoURL', process.env.MONGO_URL);\n    formData.append('collectionName', process.env.MONGO_COLLECTION);\n\n    const response = await axios.post('https://xlsxmongoapi.kurizu.repl.co/import', formData, {\n      headers: {\n        'content-type': `multipart/form-data; boundary=${formData._boundary}`,\n        'x-rapidapi-key': 'YOUR-RAPIDAPI-KEY',\n        'x-rapidapi-host': 'xlsx-mongo-api.p.rapidapi.com',\n        useQueryString: true,\n      },\n    });\n\n    console.log(response.data);\n  } catch (error) {\n    console.error(error.response.data);\n  }\n};\n\nimportFile();\n\n// Add data from XLSX file to existing MongoDB collection\nconst addData = async () =\u003e {\n  try {\n    const formData = new FormData();\n    formData.append('file', fs.createReadStream('Test.xlsx'));\n    formData.append('path', filePath);\n    formData.append('collectionName', 'test2');\n    formData.append('mongoURL', process.env.MONGO_URL);\n\n    const response = await axios.post('https://xlsxmongoapi.kurizu.repl.co/add', formData, {\n      headers: {\n        'content-type': `multipart/form-data; boundary=${formData._boundary}`,\n        'x-rapidapi-key': 'YOUR-RAPIDAPI-KEY',\n        'x-rapidapi-host': 'xlsx-mongo-api.p.rapidapi.com',\n        useQueryString: true,\n      },\n    });\n\n    console.log(response.data);\n  } catch (error) {\n    console.error(error.response.data);\n  }\n};\n\naddData();\n```\n\nCheck https://github.com/crizmo/xlsx-mongo-api/blob/main/tests/test.js for detailed usage examples.\n\n### Installation\n1. Clone the repository:\n```shell\n   git clone https://github.com/crizmo/xlsx-mongo-api.git\n```\n\n2. Install dependencies:\n```shell\n   npm install\n```\n\n3. Create a `.env` file in the root directory of the project and add the following environment variables:\n```shell\n   MONGO_URL=\u003cyour-mongodb-connection-url\u003e\n   MONGO_COLLECTION=\u003cyour-mongodb-collection-name\u003e\n```\n\n4. Start the server:\n```shell\n   npm start\n```\n\n# Contributing\n\nContributions are welcome! If you have any ideas, suggestions, or bug fixes, please open an issue or a pull request.\n\n\n# License\n\nDistributed under the MIT License. See LICENSE for more information.\nContact\n\nPackage Maintainer: crizmo on GitHub\nProject Link: https://github.com/crizmo/xlsx-mongo-api","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrizmo%2Fxlsx-mongo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrizmo%2Fxlsx-mongo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrizmo%2Fxlsx-mongo-api/lists"}