{"id":20508315,"url":"https://github.com/citrineinformatics/public_search","last_synced_at":"2025-05-09T07:31:48.183Z","repository":{"id":46932652,"uuid":"118540588","full_name":"CitrineInformatics/public_search","owner":"CitrineInformatics","description":"Public Search Helper Methods","archived":false,"fork":false,"pushed_at":"2022-12-07T10:23:28.000Z","size":618,"stargazers_count":0,"open_issues_count":9,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-11T15:43:17.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CitrineInformatics.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":"2018-01-23T01:39:45.000Z","updated_at":"2019-10-23T20:55:15.000Z","dependencies_parsed_at":"2022-09-23T09:23:02.652Z","dependency_job_id":null,"html_url":"https://github.com/CitrineInformatics/public_search","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/CitrineInformatics%2Fpublic_search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CitrineInformatics%2Fpublic_search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CitrineInformatics%2Fpublic_search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CitrineInformatics%2Fpublic_search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CitrineInformatics","download_url":"https://codeload.github.com/CitrineInformatics/public_search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224838340,"owners_count":17378283,"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-11-15T20:18:03.265Z","updated_at":"2024-11-15T20:18:03.833Z","avatar_url":"https://github.com/CitrineInformatics.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Public Search API Interface\n\nThis lib contains very specific wrappers around Citrination's public API. \nIn specific, it consists of 3 exposed methods.\n\nSee source code on [github](https://github.com/CitrineInformatics/public_search)\n\n### General Usage\n\n`npm install citrine-public-search`\n\n`yarn add citrine-public-search`\n\nThen just reference the package, `require('citrine-public-search')`.\nThe returned object literal will have the 3 methods described below\nbound to it. \n\n### Results Page\n\n```javascript\nconst citrinePublicSearch = require('citrine-public-search')\n\nconst userInput = \u003cUserRequestObject\u003e;\nconst \u003cResult\u003e = citrinePublicSearch.getResultsPageData(userInput);\n```\n\n###### UserRequestObject\n\nThe UserRequestObject is an array of Input objects\nSee src/models/input on github for Input definitions.\nAn example of this object can be found in examples/resultsPage\n\n###### Result\n\nSee models/result for implementation details. The `data` key corresponds to an\narbitrary object, which changes depending on endpoint.\n\nAn example of the `data` field of `Result` for the ResultsPage request can be found in examples/resultsPage/response\n\n###### Suggested Results\n\nIn addition to the main page results, I also provide a suggestedInput array for the links at the bottom of the mockups.\n\nThe link should make a request to `getResultsPageData` with the provided `suggestedInput` and the only argument. Upon receipt, the page should update with the new values.\n\n### Dataset Page\n\n```javascript\nconst citrinePublicSearch = require('citrine-public-search')\n\nconst datasetId = \u003cDatasetId\u003e;\nconst \u003cResult\u003e = citrinePublicSearch.getDatasetPageData(datasetId);\n```\n###### DatasetId\n\nThe ID of the dataset you are requesting, as a `number` primitive\n\n###### Result\n\nSee models/result for implementation details. The `data` key corresponds to an\narbitrary object, which changes depending on endpoint.\n\nAn example of the `data` field of `Result` for the DatasetPage request can be found in examples/datasetPage/response\n\n\n### Material Page\n\n```javascript\nconst citrinePublicSearch = require('citrine-public-search')\n\nconst chemicalFormula = \u003cChemicalFormula\u003e;\nconst \u003cResult\u003e = citrinePublicSearch.getMaterialPageData(datasetId);\n```\n###### ChemicalFormula\n\nJust a `string` that represents a Chemical Formula. See examples/materialPage/request*.json for examples\n\n###### Result\n\nSee models/result for implementation details. The `data` key corresponds to an\narbitrary object, which changes depending on endpoint.\n\nAn example of the `data` field of `Result` for the MaterialPage request can be found in examples/materialPage/response*.json\n\nNote that, depending on the material you are searching for, you may not get back certain values. For example, `request.json` doesn't return dois, imageUrls, or processDefinitions, while `request2.json` doesn't return any table data (unlikely but can occur) or composition. Be prepared to handle disparate data cases, but expect top level keys to always be served consistently.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitrineinformatics%2Fpublic_search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitrineinformatics%2Fpublic_search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitrineinformatics%2Fpublic_search/lists"}