QR codes in your terminal

qrcd.to

Easily share data from your terminal.

Get a QR code to a URL
$ curl qrcd.to/https://google.com
Get a QR code to email someone
$ curl qrcd.to/mail/hello@qrcd.to/Hello/World!
Get a QR code to connect to a wifi network
$ curl qrcd.to/wifi/SSID/secret
Get a QR code of your current public IP
$ curl qrcd.to/ip
Try it out

            
Get a help page
$ curl qrcd.to/help

Usage
  $ curl qrcd.to/hello
  $ curl qrcd.to/google.com
  $ curl qrcd.to/mail/hello@qrcd.to/Hello/World!
  $ curl qrcd.to/wifi/SSID/secret
  $ curl qrcd.to/ip

Get this help page
  $ curl qrcd.to/help                                     # Returns this help page

Get a QR code of a text
  $ curl qrcd.to/hello                                    # Returns a QR code with the provided text

Get a QR code to a URL
  $ curl qrcd.to/google.com                               # Returns a QR code to the provided URL
  $ curl qrcd.to/https://google.com                       # Returns a QR code to the provided URL

Get a QR code to email someone
  $ curl qrcd.to/mail/hello@qrcd.to[/subject[/body]]      # Returns a QR code that opens a mail client with the
                                                          # provided values

Get a QR code to connect to a wifi network
  $ curl qrcd.to/wifi/SSID/secret[/hidden[/auth type]]    # Returns a QR code that allows connecting to a wifi
                                                          # network

Get a QR code of your current public IP
  $ curl qrcd.to/ip                                       # Returns a QR code with your IP address
  $ curl ipv4.qrcd.to/ip                                  # Returns a QR code with your IPv4 address
  $ curl ipv6.qrcd.to/ip                                  # Returns a QR code with your IPv6 address

Get a QR code of a random UUID
  $ curl qrcd.to/uuid                                     # Returns a QR code with a UUID v4
  $ curl qrcd.to/uuid/v4                                  # Returns a QR code with a UUID v4
  $ curl qrcd.to/uuid/v7                                  # Returns a QR code with a UUID v7

Get a QR code of a random nano id
  $ curl qrcd.to/nanoid                                   # Returns a QR code with a standard nano id with length 21
  $ curl qrcd.to/nanoid/10                                # Returns a QR code with a standard nano id with length 10
  $ curl qrcd.to/nanoid/10/0123456789                     # Returns a QR code with a standard nano id with length 10
                                                          # and the provided alphabet [0-9]



Options
Some options can be passed with the request as query parameters

  level=l                                                 # Sets the error correction level to low (7%)
  level=m (default)                                       # Sets the error correction level to medium (15%)
  level=q                                                 # Sets the error correction level to quartile (25%)
  level=h                                                 # Sets the error correction level to high (30%)

  out=shell (default if http header Accept=*/*)           # The QR code is created from shell control characters
  out=block (default)                                     # The QR code is created from Unicode blocks
  out=square                                              # The QR code is created from Unicode squares



POSTing the payload
In addition to passing the QR code text as path parameter (curl qrcd.to/Hello%20World) you can pass it in the
request body of a POST request. This allows using curls --data setting.

  $ curl -d 'Hello World' qrcd.to
  $ curl -d 'mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.' qrcd.to
  $ curl -d @path/to/file.txt qrcd.to



URL encoding the payload
In addition to passing the QR code text as path parameter (curl qrcd.to/Hello%20World) you can pass it as a query
parameter "text" (curl "qrcd.to?text=Hello%20World"). This allows using curls --data-urlencode setting to URL encode
the text.

  $ curl -G --data-urlencode 'text=Hello World' qrcd.to
  $ curl -G --data-urlencode 'text=mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.' qrcd.to
  $ cat path/to/file.txt | curl -G --data-urlencode text@- qrcd.to

The query parameter text is appended to the path parameter text.



Piping to stdin
You can pipe text from a file or another command with curls @- syntax either using the POST method or text query
parameter.

  $ cat path/to/file.txt | curl -d @- qrcd.to
  $ echo -n hello | curl -d @- qrcd.to
  $ cat path/to/file.txt | curl -G --data-urlencode text@- qrcd.to
  $ echo -n hello | curl -G --data-urlencode text@- qrcd.to



Other clients
HTTPie

  $ https qrcd.to/google.com
  $ https 'qrcd.to/mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.'
  $ https --raw 'mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.' qrcd.to
  $ https qrcd.to < path_to_file.txt
  $ echo -n hello | https qrcd.to

wget

  $ wget -O - qrcd.to/google.com
  $ wget -O - 'qrcd.to/mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.'
  $ wget -O - --post-data 'mail/hello@qrcd.to/Hello/Hello qrcd.to. This message contains spaces.' qrcd.to