Skip to content

Instantly share code, notes, and snippets.

@kelly-liu
kelly-liu / curl_example.ps1
Last active February 21, 2019 18:25 — forked from kbridbur/curl_example.txt
Use the Rev.ai API with curl!
$ YOUR_ACCESS_TOKEN=<your access token here>
# Send an audio file to Rev.ai
$ curl -X POST https://api.rev.ai/speechtotext/v1/jobs \
-H "Authorization: Bearer ${YOUR_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{'media_url':'https://www.rev.ai/FTC_Sample_1.mp3'}"
# Retrieve your transcript
$ ID=<your job id here>
@kelly-liu
kelly-liu / python_example.py
Last active February 20, 2019 23:45 — forked from kbridbur/python_example.py
Use the Rev.ai API with Python!
# import rev_ai and create your client using your access token.
from rev_ai import apiclient as api
YOUR_ACCESS_TOKEN = "your access token here"
client = api.RevAiAPIClient(YOUR_ACCESS_TOKEN)
# send an audio file to rev.ai
job = client.submit_job_url("https://www.rev.ai/FTC_Sample_1.mp3")
# retrieve your transcript
import subprocess
import argparse
import os
import boto3
import urllib
from urllib.request import urlopen
import datetime
from datetime import datetime
s3 = boto3.client('s3')