Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
Use a Firebase storage URL with moderatecontent API

I'd like to be able to check, via an API, if an image uploaded to Firebase storage is NSFW.

I want to do it with moderatecontent.com and this is what I tried

  axios.get('https://api.moderatecontent.com/moderate/', {
    params: {
      key: '50f4e0ecf62fdef40abf30a102c8d055',
      url: img,
    },
  })

The issue I have is that the Firebase URL comes with a token like so

https://firebasestorage.googleapis.com/v0/b/something.appspot.com/o/imagename?alt=media&token=SOMETOKEN

the problem is that the token ends up being used as a param in the request. My Firebase Storage rules are

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read: if true;
      allow write: if request.auth != null;
    }
  }
}

Do you have any idea how to make moderatecontent api access the url directly?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Full disclosure: I work for moderatecontent.com

A GET request with a URL that includes a query string, often will not work, due to the image query string interfering with the GET query string.

https://firebasestorage.googleapis.com/v0/b/something.appspot.com/o/imagename?alt=media&token=SOMETOKEN

https://api.moderatecontent.com/moderate/?url=https://firebasestorage.googleapis.com/v0/b/something.appspot.com/o/imagename?alt=media&token=SOMETOKEN&key=12344df5dfad1234e05fd617dee81234

The moderatecontent.com API includes support for a POST request (as well as base64), and these two options allow for an image URL with a query string.

For example:

var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'url': 'https://www.moderatecontent.com/img/sample_face_6.jpg',
  'key': '12344df5dfad1234e05fd617dee81234' 
});
var config = {
  method: 'post',
  url: 'https://api.moderatecontent.com/moderate/',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!