Note that there are some explanatory texts on larger screens.

plurals
  1. POREST API of opencorporates
    primarykey
    data
    text
    <p>Is it possible to access 100 companies and their ids using REST API of opencorporates ? </p> <p>Currently this is my nodejs script:</p> <pre><code>var http = require('http'); var optionsget = { host : 'api.opencorporates.com', port : 80, path : '/v0.2/companies/search?q=barclays+bank', method : 'GET' }; console.info('Options prepared:'); console.info(optionsget); console.info('Do the GET call'); var reqGet = http.get(optionsget, function(res) { console.log("statusCode: ", res.statusCode); console.log("headers: ", res.headers); buffer=''; res.on('data', function(d) { //console.info('GET result:\n'); //process.stdout.write(d); buffer+=d.toString(); //console.info('\n\nCall completed'); }); res.on('end',function() { console.info('GET result:\n'); console.log(buffer); console.info('\n\nCall completed'); }); }); reqGet.on('error', function(e) { console.error(e); }); reqGet.end(); </code></pre> <p>This fetches a list of companies that matches my search query. </p> <p>How can I access 100 companies(list of companies given by user) with their respective ids?</p> <p>I have two questions: 1. How to get user input? I got this. 2. How to modify the url based on what user wants to search? If user wants to search for a company so url would be /v0.2/companies/search?q=barclays+bank and another user wants to search by name of the company and jurisdiction so url would be <a href="http://api.opencorporates.com/v0.2/companies/search?q=barclays+bank&amp;jurisdiction_code=gb" rel="nofollow">http://api.opencorporates.com/v0.2/companies/search?q=barclays+bank&amp;jurisdiction_code=gb</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload