Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

95
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda