Akkio Docs
  • Akkio Documentation
    • Akkio FAQ
  • Account and Settings
    • Team Settings
    • Organization Settings
    • Account Settings
    • Role Based Access Control
  • Demo Models
    • Demo Models
      • Lead Scoring
      • Retail Sales Forecasting
      • Predict Credit Card Fraud
      • Identify Customer Churn
  • Setting up Integrations
    • Connecting Data
    • Airtable (Beta)
    • Google Ads (Beta)
    • Google Analytics 4 (Beta)
    • Google BigQuery
    • Google BigQuery (Service Account)
    • Google Sheets
    • HubSpot (Beta)
    • MariaDB (Beta)
    • MongoDB (Beta)
    • MySQL (Beta)
    • PostgreSQL (Beta)
    • Redshift (Beta)
    • Salesforce
    • Akkio Data Chat for Slack
    • Snowflake (Username / Password) (Beta)
    • Zapier
  • Prepare your Data
    • Prepare
      • Chat Data Prep
      • Clean
      • Merge & Fuzzy Merge
      • Table View
      • Pivot View
      • Deploying Chat Data Prep
  • Explore
    • Chat Explore
    • Chart Types
  • Building a Model
    • Predict
      • Insights Report - Classification
      • Insights Report - Regression
    • Forecasting
      • Insights Report - Forecasting
    • Model Types
  • Deploying a Model
    • Deploy
      • Google BigQuery
      • Google Sheets
      • HubSpot (Beta)
      • PostgreSQL (Beta)
      • Salesforce
      • Snowflake (Beta)
      • Web App
      • Zapier
  • REPORTING AND SHARING
    • Reports
    • Dashboards
  • REST API
    • API Introduction
      • Quickstart
    • API Options
      • cURL Commands
      • Python Library
      • Node.js Library
    • API FAQ
  • Rest API (v2)
    • Documentation
Powered by GitBook
On this page
  • API Keys
  • Test Code

Was this helpful?

  1. REST API
  2. API Introduction

Quickstart

Get up and running with the Akkio API using one of our convenient libraries.

PreviousAPI IntroductionNextAPI Options

Last updated 1 year ago

Was this helpful?

API Keys

As noted in the code samples below, you must get your API keys and copy them into your API code. Those can be found under the at the bottom of the Akkio app.

Test Code

Installation

npm install akkio --save

Usage

const akkio = require('akkio')('your API key');
#get your API key at https://app.akkio.com/team-settings


(async () => {
  #create a new dataset
  let newDataset = await akkio.createDataset('my new dataset');

  #populate it with some toy data
  let rows = [];
  for (var i = 0; i < 1000; i++) {
okay     let x = Math.random();
    rows.push({
      'x': x,
      'value larger than 0.5': x > 0.5,
    });
  }
  await akkio.addRowsToDataset(newDataset.dataset_id, rows);

  # train a model
  let model = await akkio.createModel(newDataset.dataset_id, ['value larger than 0.5'], [], {
    duration: 1
  });

  ## field importance
  for (let field in model.field_importance) {
    console.log('field:', field, 'importance:', model.field_importance[field]);
  }

  # model stats
  for (let field of model.stats) {
    for (let outcome of field) {
      console.log(outcome);
    }
  }

  # use the trained model to make predictions
  let predictions = await akkio.makePrediction(model.model_id, [{
    'x': 0.25
  }, {
    'x': 0.75
  }], {
    explain: true
  });
  console.log(predictions);

})();

Installation

The akkio library is available on Python 3 and can be installed easily on your python instance. Run the following command or search your available packages for akkio (image also below.

pip install akkio

Usage

import akkio
akkio.api_key = 'YOUR-API-KEY-HERE' 
# get your API key at https://app.akkio.com/team-settings

models = akkio.get_models()['models']
for model in models:
  print(model)

datasets = akkio.get_datasets()['datasets']
for dataset in datasets:
  print(dataset)

new_dataset = akkio.create_dataset('python api test')
print(new_dataset)

# create a toy dataset
import random
rows = []
for i in range(1000):
  rows.append({
    'x': random.random()
  })
  rows[-1]['y'] = rows[-1]['x'] > 0.5

akkio.add_rows_to_dataset(new_dataset['dataset_id'], rows)

new_model = akkio.create_model(new_dataset['dataset_id'], ['y'], [], {'duration': 1})
print(new_model)
prediction = akkio.make_prediction(new_model['model_id'], [{'x': 0.1}, {'x':0.7}], explain=True)
print(prediction)

Once you have installed the Akkio custom package and run the above Usage code you should be able to go to app.akkio.com and see an api test project as shown here.

team settings page