Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

94
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda