{"id":10078,"date":"2023-11-19T09:00:20","date_gmt":"2023-11-19T09:00:20","guid":{"rendered":"https:\/\/brightworldlabs.com\/?page_id=10078"},"modified":"2025-10-15T17:55:37","modified_gmt":"2025-10-15T17:55:37","slug":"oncilla-api","status":"publish","type":"page","link":"https:\/\/brightworldlabs.com\/ar\/oncilla-api\/","title":{"rendered":"Oncilla API"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><section class=\"vc_section\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\t\t<div id=\"wd-65d4762774ea9\" class=\"wd-text-block wd-wpb reset-last-child wd-rs-65d4762774ea9 text-left \">\n\t\t\t<h1>Oncilla API | Location Intelligence | AWS<\/h1>\n\t\t<\/div>\n\t\t\n\t<div  class=\"wpb_single_image wpb_content_element vc_align_left\">\n\t\t\n\t\t<figure class=\"wpb_wrapper vc_figure\">\n\t\t\t<div class=\"vc_single_image-wrapper   vc_box_border_grey\"><img decoding=\"async\" class=\"vc_single_image-img \" src=\"https:\/\/brightworldlabs.com\/wp-content\/uploads\/2023\/06\/line-60x3.png\" width=\"60\" height=\"3\" alt=\"line\" title=\"line\" loading=\"lazy\" \/><\/div>\n\t\t<\/figure>\n\t<\/div>\n<\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid vc_row-o-equal-height vc_row-o-content-top vc_row-flex wd-rs-658a9d3c73f07\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><div class=\"vc_row wpb_row vc_inner vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\t\t<div id=\"wd-6596870697ca8\" class=\"wd-text-block wd-wpb reset-last-child wd-rs-6596870697ca8 text-left \">\n\t\t\t<h4>How to use the Oncilla API to geoparse your text.<\/h4>\n\t\t<\/div>\n\t\t<\/div><\/div><\/div><\/div>\t\t<div id=\"wd-658a9d863ec5e\" class=\"wd-image wd-wpb wd-rs-658a9d863ec5e text-left  inline-element\">\n\t\t\t\n\t\t\t<img decoding=\"async\" class=\"\" src=\"https:\/\/brightworldlabs.com\/wp-content\/uploads\/2023\/12\/BrightWorldLabs_Oncilla_Logo-150x150.png\" width=\"150\" height=\"150\" alt=\"Oncilla Logo\" title=\"Oncilla | Geoparser | Location Intelligence\" loading=\"lazy\" \/>\n\t\t\t\t\t<\/div>\n\t\t\n\t<div class=\"wpb_text_column wpb_content_element inline-element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p><strong>Step 1:<\/strong> Create an <a href=\"https:\/\/docs.aws.amazon.com\/IAM\/latest\/UserGuide\/id_users_create.html\">AWS IAM account<\/a>.<\/p>\n<p><strong>Step 2:<\/strong> Subscribe to <a href=\"https:\/\/aws.amazon.com\/marketplace\/pp\/prodview-opd5hiy6udvca\">Oncilla in the AWS Marketplace<\/a>.<\/p>\n<p><strong>Step 3:<\/strong> Configure your <a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-configure-files.html\">AWS credentials<\/a>.<\/p>\n<p><strong>Step 4:<\/strong> Start using Oncilla!<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\t\t<div id=\"wd-68efdcff75778\" class=\"wd-text-block wd-wpb reset-last-child wd-rs-68efdcff75778 text-left \">\n\t\t\t<h4>Call the Oncilla API using the AWS CLI.<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">aws dataexchange send-api-asset \\\r\n--data-set-id 97b9c546368629960e63b8c0f6edbea9 \\\r\n--revision-id 16c060acfe4cc7cdf08c0ca499bc1093 \\\r\n--asset-id 5a779b06b6cfcdff958d4707afa6a5ae \\\r\n--method POST \\&lt;br \/&gt;--path \"\/geoparse\" \\\r\n--request-headers 'Content-Type=application\/json' \\\r\n--body \"[{\\\"recordId\\\": \\\"a1\\\", \\\"data\\\": {\\\"text\\\": \\\"Monsoon rains are forecast to continue over the deserts in the Southwest and up into the Rocky Mountains, with potential for flash flooding in Arizona, Utah, Colorado and Wyoming on Sunday.\\\", \\\"lang\\\": \\\"en\\\", \\\"informal\\\": false}}]\"<\/pre>\n\t\t<\/div>\n\t\t<\/div><\/div><\/div><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<h4>Call the Oncilla API using Python code.<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">import json\r\nimport boto3\r\n\r\n\r\naws_client = boto3.client('dataexchange')\r\n\r\n\r\ndef geoparse(api_data, client):\r\n    response = client.send_api_asset(\r\n      DataSetId='97b9c546368629960e63b8c0f6edbea9',\r\n      RevisionId='16c060acfe4cc7cdf08c0ca499bc1093',\r\n      AssetId='5a779b06b6cfcdff958d4707afa6a5ae',\r\n      Method='POST',\r\n      Path='\/geoparse',\r\n      RequestHeaders={\r\n          'Content-Type': 'application\/json'\r\n      },\r\n      Body=json.dumps(api_data)\r\n    )\r\n    return response\r\n\r\n\r\napi_data = {\r\n  \"values\": [{\r\n      \"recordId\": 'a1',\r\n      \"data\": {\r\n        \"text\": 'Monsoon rains are forecast to continue over the deserts in the Southwest and up into the Rocky Mountains, with potential for flash flooding in Arizona, Utah, Colorado and Wyoming on Sunday.',\r\n        \"lang\": \"en\",\r\n        \"informal\": False\r\n      }\r\n    },\r\n    {\r\n      \"recordId\": 'a2',\r\n      \"data\": {\r\n        \"text\": 'The Africa CDC is based at the Africa CDC Coordinating Centre in Addis Ababa, Ethiopia, which also contains the agency\\'s Emergency Operations Centre.',\r\n        \"lang\": \"en\",\r\n        \"informal\": False\r\n      }\r\n    }]\r\n}\r\n\r\nresults = geoparse(api_data, aws_client)\r\noutput = json.loads(results['Body'].replace('\\\"', '\"'))\r\n# output contains the geoparsed results for the final batch\r\nprint(output)\r\n<\/pre>\n\n\t\t<\/div>\n\t<\/div>\n<pre id=\"pythonCode\" style=\"font-size: small; background-color: #eee; border-radius: 3px; font-family: courier,monospace; padding: 0 3px;\"><\/pre>\r\n<script>\r\n    const loc2 = window.location.href;\r\n    const urlParams2 = loc2.split('#')[1].split('&');\r\n    let accessToken2 = '';\r\n    for (let i = 0; i < urlParams2.length; i++) {\r\n        if (urlParams2[i].startsWith('access_token')) {\r\n            accessToken2 = urlParams2[i].split('=')[1]\r\n        }\r\n    }\r\n    let pythonCodeEle = document.getElementById('pythonCode');\r\n    if (pythonCodeEle) {\r\n        let pythonDiv = document.createElement('code');\r\n        let pythonCode = 'import requests \\n'\r\n            + 'import json \\n'\r\n            + '\\n'\r\n            + 'url = \"https:\/\/s1scmjyrja.execute-api.eu-west-1.amazonaws.com\/dev\/geoparse\" \\n'\r\n            + '\\n'\r\n            + 'payload = json.dumps({\\n'\r\n            + '  \"values\": [\\n'\r\n            + '    {\\n'\r\n            + '      \"recordId\": \"a1\",\\n'\r\n            + '      \"data\": {\\n'\r\n            + '        \"text\": \"Text to Parse\",\\n'\r\n            + '        \"lang\": \"en\",\\n'\r\n            + '        \"informal\": False\\n'\r\n            + '      }\\n'\r\n            + '    }\\n'\r\n            + '  ]\\n'\r\n            + '})\\n'\r\n            + 'headers = {\\n'\r\n            + '  \\'Content-Type\\': \\'application\/json\\',\\n'\r\n            + '  \\'Authorization\\': \\'' + accessToken2 + '\\'\\n'\r\n            + '}'\r\n            + '\\n'\r\n            + 'response = requests.request(\"POST\", url, headers=headers, data=payload)\\n'\r\n            + '\\n'\r\n            + 'print(response.text)\\n';\r\n        pythonDiv.append(pythonCode);\r\n        pythonCodeEle.append(pythonDiv);\r\n    }\r\n<\/script><\/div><\/div><\/div><\/div><\/section>\n<\/div>","protected":false},"excerpt":{"rendered":"Oncilla API | Location Intelligence | AWS How to use the Oncilla API to geoparse your text. Step 1: Create","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-10078","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/pages\/10078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/comments?post=10078"}],"version-history":[{"count":32,"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/pages\/10078\/revisions"}],"predecessor-version":[{"id":10243,"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/pages\/10078\/revisions\/10243"}],"wp:attachment":[{"href":"https:\/\/brightworldlabs.com\/ar\/wp-json\/wp\/v2\/media?parent=10078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}