84 lines
1.7 KiB
Markdown
84 lines
1.7 KiB
Markdown
# VAT-number-finder-API (Node.js)
|
|
|
|
This is a minimal Node.js + Express server that acts as an API wrapper around Finančná správa SR's open data interface.
|
|
It allows you to look up Slovak companies by their IČO number (company identifier).
|
|
|
|
## Features
|
|
|
|
- Accepts GET requests with an IČO as query parameter
|
|
- Returns company information in JSON format
|
|
- Built with Express and Axios
|
|
- Hardcoded API key for simplicity
|
|
|
|
## Setup Instructions
|
|
|
|
1. Download and extract the project
|
|
2. Open `server.js` and replace:
|
|
|
|
```
|
|
const API_KEY = "your_api_key_here";
|
|
```
|
|
|
|
with your actual API key from [https://iz.opendata.financnasprava.sk](https://iz.opendata.financnasprava.sk)
|
|
|
|
3. In the project directory, run:
|
|
|
|
```bash
|
|
npm install express axios
|
|
```
|
|
|
|
4. Start the server:
|
|
|
|
```bash
|
|
node server.js
|
|
```
|
|
|
|
5. Use the API:
|
|
|
|
Open your browser or use curl/Postman:
|
|
|
|
```
|
|
http://localhost:3000/api/lookup?ico=36215589
|
|
```
|
|
|
|
### Example response
|
|
|
|
```json
|
|
{
|
|
"source1_count": 1,
|
|
"source2_count": 1,
|
|
"merged_count": 2,
|
|
"data": [
|
|
{
|
|
"id": 3081331,
|
|
"dic": "2020041199",
|
|
"ico": "36215589",
|
|
"nazov_ds": "Singularity, s.r.o.",
|
|
"obec": "Michalovce",
|
|
"psc": "07101",
|
|
"ulica_cislo": "Nám. Slobody 7",
|
|
"nazov_statu": "Slovensko"
|
|
},
|
|
{
|
|
"id": 229825,
|
|
"ic_dph": "SK2020041199",
|
|
"ico": "36215589",
|
|
"nazov_ds": "Singularity, s.r.o.",
|
|
"obec": "Michalovce",
|
|
"psc": "07101",
|
|
"ulica_cislo": "Nám. Slobody 7",
|
|
"stat": "Slovensko",
|
|
"druh_reg_dph": "§4",
|
|
"datum_reg": "01.09.2002",
|
|
"datum_zmeny_druhu_reg": "",
|
|
"plat_dph_od": "01.09.2002"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Requirements
|
|
|
|
- Node.js 14 or newer
|
|
- Internet connection
|
|
- Valid API key from Finančná správa SR |