{"id":16200948,"url":"https://github.com/marks/nodejs-iqengines","last_synced_at":"2025-04-07T18:16:34.965Z","repository":{"id":2146264,"uuid":"3091036","full_name":"marks/nodejs-iqengines","owner":"marks","description":"NodeJS IQ Engines API bindings","archived":false,"fork":false,"pushed_at":"2012-01-03T00:29:10.000Z","size":165,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T20:15:02.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://developer.iqengines.com/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marks.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":"2012-01-03T00:29:04.000Z","updated_at":"2018-12-20T12:52:47.000Z","dependencies_parsed_at":"2022-09-09T18:01:24.711Z","dependency_job_id":null,"html_url":"https://github.com/marks/nodejs-iqengines","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/marks%2Fnodejs-iqengines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnodejs-iqengines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnodejs-iqengines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnodejs-iqengines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marks","download_url":"https://codeload.github.com/marks/nodejs-iqengines/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704572,"owners_count":20982298,"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-10-10T09:34:56.783Z","updated_at":"2025-04-07T18:16:34.921Z","avatar_url":"https://github.com/marks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IQ Engines NodeJS API Bindings #\n\n### Dependencies ###\n\n- **[NodeJS][1] version 0.4.0 or greater**\n- **[npm][2] (optional for easier installation)**\n\n### Install ###\n\nYou can install the module by using npm and running the command below.\n\n    npm install iqengines\n\nOr, you can also use this module by including it directly inside your project directory.\n\n# Example Usage #\n    \n    function onQuerySent (response) {\n        console.log(\"=\u003e Query with qid=\" + qid + \" sent!\");\n        console.log(JSON.stringify(response));\n    }\n\n    function onResultsReady (response) {\n        console.log(\"=\u003e Results found! printing ..\");\n        console.log(JSON.stringify(response));\n    }\n    \n    var iqengines = require('iqengines'),\n        api       = new iqengines.Api(\u003cYOUR_KEY\u003e, \u003cYOUR_SECRET\u003e),\n        qid       = api.sendQuery({img: 'sample.png'}, onQuerySent); \n    api.waitResults({}, onResultsReady);\n\n# Api Reference #\n\n\u003cbr\u003e\n### new Api(key, secret) ###\n\nA constructor that returns a handle to the iqengines API. `key` and `secret` is your API key/secret obtained from signing up for an account at [http://developer.iqengines.com/][3]. If these are left undefined, the module will look up their values from the `IQE_KEY` and `IQE_SECRET` environment variables.\n\n\u003cbr\u003e\n\u003cbr\u003e\n### Api.sendQuery(options, [callback])###\n\nSends an image query to the iqengines servers. Returns a `qid` representing the unique identifier for the given query. *callback* is a function taking a single argument `response`. It is called when you've successfully sent a query to the iqengiens server.\n\n**Options:**\n\n- img - The file path to your image (jpg, png) (required)\n- multiple_results - If true then all identified images are returned in the results (default = null)\n- device_id - A unique string used to filter out the results when retrieving results using the waitResult method (default = null)\n- webhook - The URL where the results are sent via HTTP POST once the results have been computed (default = null)\n- extra - A string that is posted back when the webhook is called or when retreiving results. It is useful for passing JSON-encoded extra parameters about the query that your application can then use once the results are available (default = null)\n- json - If true, then the response sent to the callback is formatted as a JSON object (default = true)\n    \n\n\u003cbr\u003e\n\u003cbr\u003e\n### Api.getResult(options, callback) ###\n\nRetrieves the result for a given query. *callback* is a function taking a single argument representing the response from the IQ Engines server. It is called when IQ Engines responds to the getResult request. *response* here will either contain the results of the query if it has been processed or a message specifying that query has not been processed yet.\n\n- qid - The unique identifier returned from the *sendQuery* method (default = true)\n- json - If true, then the response sent to the callback is formatted as a JSON object (default = true)\n\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n### Api.waitResults(options, callback) ###\n\nOpens a long polling connection to the IQ Engines servers and waits until results are ready. *callback* is a function taking a single argument representing the response from the IQ Engines server. It is called when results are ready. \n\n- device_id - if given, the waitResult call will only return when results are ready from queries sent with the corresponding device\\_id (default = null)\n- json - If true, then the response sent to the callback is formatted as a JSON object (default = true)\n\n[1]: http://nodejs.org/\n[2]: http://npmjs.org/\n[3]: http://developer.iqengines.com/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarks%2Fnodejs-iqengines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarks%2Fnodejs-iqengines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarks%2Fnodejs-iqengines/lists"}