Ask Siri to buy some bitcoin for you

This tutorial will help you setup your own system that lets you buy Bitcoin with a hands-free experience.

Harsh Vakharia
2 min readOct 25, 2020
Hey Siri, buy some bitcoin for me

Prerequisites

  1. Vercel account
  2. Zebpay Developer account
  3. Shortcuts app

1. Create your Zebpay Application

  1. Visit Zebpay Developer Portal
  2. Sign-in & create your application (any app type would work)
  3. Once submitted & approved, go to GenerateToken tab
  4. Make sure trade:read & trade:create are checked
  5. Click on Generate Token
  6. Copy your client_id & token.access_token

2. Deploy your instance

You will need to keep following values handy;

  • APP_PASSCODE: Use a strong passcode openssl rand -base64 32
  • APP_MAX_AMOUNT: Max amount that can be bought by this application at once
  • ZEBPAY_CLIENT_ID: Your Zebpay application client_id
  • ZEBPAY_ACCESS_TOKEN: Your Zebpay application token.access_token

Time to deploy your instance 🚀

3. Create your Siri shortcut

There are two ways to do this.

Create you shortcut manually

  1. Open Shortcuts app
  2. Tap on + icon on top right corner
  3. Tap on + icon on the screen to add actions
  4. Search for Ask for Input action & add it
  5. Change input type from Text to Number
  6. Edit prompt to For how much?
  7. Search for Get Contents of URL action & add it
  8. Set your buy function URL
  9. Click on Show More
  10. Change method to POST
  11. Click on Headers & then Add new header
  12. Set Key to X-Passcode & value to your APP_PASSCODE
  13. Change Request Body to Form
  14. Click on Add new field & select Text
  15. Click on the value field, and select Provided Input
  16. Search for Show Result action & add it
  17. Name your shortcut Buy Bitcoin

Create your shortcut using link

  1. Open Settings app
  2. Go to Shortcuts settings
  3. Toggle on Allow Untrusted Shortcuts
  4. Open Buy Bitcoin shortcut on your device

Similarly, you can also setup a shortcut to schedule your bitcoin purchase using events in Shortcuts app.

Originally published at https://harshjv.com on October 25, 2020.

--

--

Harsh Vakharia

An engineer by passion, a creator by heart, an admirer of simplicity.