Using CURL
Economy API provides a very simple interface by which the user can fetch data from the CMIE Databases.
For One Company using POST
curl -X POST -d "username=USER_NAME&apikey=YOUR_API_KEY&scheme=MITS&indicnum=12692320,12252477,12692320,96653,15551738,2,15551706,12677767,12252477,12750647&freq=Q&nperiod=14" -O -J "https://economyapi.cmie.com/query.php"
For Multiple Companies using POST
curl -X POST -d "apikey=YOUR_API_KEY&company_code[]=196667&company_code[]=529139" -O -J "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
For One Company using JSON POST
curl -X POST -H "Content-Type: application/json" -d @apikey_single.json -O -J "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
JSON file content <apikey_single.json>
{
"apikey":"YOUR_API_KEY",
"company_code":["196667"]
}
For Multiple Companies using JSON POST
curl -X POST -H "Content-Type: application/json" -d @apikey_multiple.json -O -J "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
JSON file content <apikey_multiple.json>
{
"apikey":"YOUR_API_KEY",
"company_code":["196667", "529139"]
}
Using WGET
For One Company using POST
wget --content-disposition --post-data "apikey=YOUR_API_KEY&company_code[]=196667" "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
For Multiple Companies using POST
wget --content-disposition --post-data "apikey=YOUR_API_KEY&company_code[]=196667&company_code[]=529139" "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
For One Company using JSON POST
wget --content-disposition --header='Content-Type: application/json' --post-file apikey_single.json "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
JSON file content <apikey_single.json>
{
"apikey":"YOUR_API_KEY",
"company_code":["196667"]
}
For Multiple Companies using JSON POST
wget --content-disposition --header='Content-Type: application/json' --post-file apikey_multiple.json "http://economyapi.cmie.com/kommon/bin/sr.php?kall=wapicall"
JSON file content <apikey_multiple.json>
{
"apikey":"YOUR_API_KEY",
"company_code":["196667", "529139"]
}