Skip to content

Instantly share code, notes, and snippets.

import scaleapi
client = scaleapi.ScaleClient('test_6caca11856814b3128e17c74767d6d0a')
client.create_lineannotation_task(
callback_url='http://www.example.com/callback',
instruction='Annotate lines over all of the **lane lines** in the street-level image.',
attachment_type='image',
attachment='http://i.imgur.com/XOJbalC.jpg',
objects_to_annotate=['solid line', 'dashed line'],
import scaleapi
client = scaleapi.ScaleClient('test_6caca11856814b3128e17c74767d6d0a')
client.create_pointannotation_task(
callback_url='http://www.example.com/callback',
instruction='Draw a point on every **headlight** and **brakelight** of a car in the image.',
attachment_type='image',
attachment='http://i.imgur.com/XOJbalC.jpg',
objects_to_annotate=['headlight', 'brakelight'],
import scaleapi
client = scaleapi.ScaleClient('test_6caca11856814b3128e17c74767d6d0a')
client.create_polygonannotation_task(
callback_url='http://www.example.com/callback',
instruction='Draw a tight polygon around every **car** in the image.',
attachment_type='image',
attachment='http://i.imgur.com/XOJbalC.jpg',
objects_to_annotate=['car', 'truck'],
import scaleapi
client = scaleapi.ScaleClient('test_6caca11856814b3128e17c74767d6d0a')
client.create_segmentannotation_task(
callback_url='http://www.example.com/callback',
instruction='Please segment the image using the given labels.',
attachment_type='image',
attachment='http://i.imgur.com/XOJbalC.jpg',
labels=['vehicle', 'background', 'road', 'vegetation', 'lane marking'],
@alexandr
alexandr / sample.py
Created December 6, 2016 22:58
Audio Transcription Sample API request
import scaleapi
client = scaleapi.ScaleClient('SCALE_API_KEY')
client.create_audiotranscription_task(
callback_url='http://www.example.com/callback',
attachment_type='audio',
attachment='https://www.scaleapi.com/client/audio/sample.wav',
verbatim=False
)
@alexandr
alexandr / sample.py
Created November 22, 2016 22:14
Sample Python API request
import scaleapi
client = scaleapi.ScaleClient('SCALE_API_KEY')
client.create_categorization_task(
callback_url='http://www.scaleapi.com/demo/callback',
instruction='Did this user behave inappropriately? Would it be inappropriate for someone under the age of 13 to view?',
attachment_type='website',
attachment='https://twitter.com/scaleAPI/status/777926247330353152',
categories=['yes', 'no']
@alexandr
alexandr / sample.sh
Created November 22, 2016 22:09
Sample Content Moderation Request
curl "https://api.scaleapi.com/v1/task/categorize" \
-u DEMO_API_KEY: \
-d callback_url="http://www.scaleapi.com/demo/callback" \
-d instruction="Did this user behave inappropriately? Would it be inappropriate for someone under the age of 13 to view?" \
-d attachment_type=website \
-d attachment="https://twitter.com/scaleAPI/status/777926247330353152" \
-d categories=yes \
-d categories=no
@alexandr
alexandr / data_collection_example.sh
Created October 21, 2016 18:57
Data Collection Example
curl "https://api.scaleapi.com/v1/task/datacollection" \
-u "SCALE_API_KEY:" \
-d callback_url="http://www.example.com/callback" \
-d instruction="Find the URL for the hiring page for the company with attached website." \
-d attachment_type=website \
-d attachment="https://www.scaleapi.com/" \
-d fields[hiring_page]="Hiring Page URL"
@alexandr
alexandr / sentiment_sample.sh
Last active October 20, 2016 00:37
Brand Equity Example
curl "https://api.scaleapi.com/v1/task/categorize" \
-u "SCALE_API_KEY:your_api_key" \
-d callback_url="http://www.example.com/callback" \
-d instruction="What was the sentiment of the tweet?" \
-d attachment_type=text \
-d attachment="I <3 Kellogg! Best breakfast everyday." \
-d categories="Extremely Positive" \
-d categories="Somewhat Positive" \
-d categories="Neutral" \
-d categories="Somewhat Negative" \
@alexandr
alexandr / sample.sh
Last active October 20, 2016 00:38
Brand Equity Example
curl "https://api.scaleapi.com/v1/task/categorize" \
-u "SCALE_API_KEY:" \
-d callback_url="http://www.example.com/callback" \
-d instruction="What brand does this cereal box belong to?" \
-d attachment_type=image \
-d attachment="https://pbs.twimg.com/media/CuMvJ1BXYAAYsd8.jpg" \
-d categories="Kellogg" \
-d categories="General Mills" \
-d categories="Post Holdings" \
-d categories="Whole Foods" \