1

I'm trying to GET data from firebase by REST. My firebase database looks like this

enter image description here

So I want to fetch it with curl:

curl 'https://smwtest-15295.firebaseio.com/WHAT_HERE?'

but I don't know what to put as request url params.

1 Answer 1

3

Your URIs have to end with .json, as shown in the documentation you refer to.

For example:

curl 'https://smwtest-15295.firebaseio.com/9099.json'

or

curl 'https://smwtest-15295.firebaseio.com/9099/address.json'

Then you can filter or order your data by adding query string parameters.


If you want to query the entire JSON tree, use:

curl 'https://smwtest-15295.firebaseio.com/.json'

More details in the REST API Reference.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks a lot, I'm a little bit surprised by that wierd "DOTjson" thing at the end
The .json suffix is used by Firebase to recognize REST requests. Without .json at the end of the URL, it would be interpreted as a request to the Firebase console. Give it a try by entering https://smwtest-15295.firebaseio.com/ into your browser, and you'll see the difference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.