REST API Quickstart Guide

First, you'll need to sign up to get your own Firebase.

Basic Requests

You can use any Firebase URL as a REST endpoint. All you need to do is append .json to the end of the URL and send a request from your favorite HTTPS client.

Here we read some data from the root of our Firebase:

curl https://SampleChat.firebaseio-demo.com/.json

Next, we write data at /users/fred:

curl -X PUT -d "\"Hello World\"" https://SampleChat.firebaseio-demo.com/users/fred.json

Then we read the data back again, with pretty-print enabled.

curl https://SampleChat.firebaseio-demo.com/.json?print=pretty

Please note the requirement to use HTTPS instead of HTTP.
Firebase makes security a priority and only accepts encrypted connections.

Realtime Events

Firebase REST endpoints even support realtime updates via the EventSource / Server-Sent Events protocol.

After setting up your HTTPS request, you will receive events like this.

event: event name
data: JSON encoded data payload

That's it! To learn more, read the full REST API Reference.

Next Steps


Have a suggestion to improve the documentation on this page? Tell us!