npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pinterest-scraper-api

v1.0.0

Published

Un scraper de Pinterest que utiliza la API de pinscrapper.vercel.app para buscar imágenes y extraer enlaces directos.

Downloads

7

Readme

Pinterest Scraper API

npm version downloads license node version Build Status

Un paquete de Node.js potente para buscar imágenes en Pinterest

Extrae enlaces directos de imágenes utilizando la API de pinscrapper.vercel.app


Características Principales

Búsqueda Potente

  • Encuentra cualquier imagen en Pinterest
  • Soporte para búsquedas en español e inglés
  • Filtros avanzados de resultados

Ultra Rápido

  • Resultados en milisegundos
  • Optimizado para rendimiento
  • Cache inteligente incluido

Enlaces Directos

  • URLs de imágenes listas para usar
  • Sin redirects ni proxies
  • Máxima calidad disponible

Metadata Completa

  • Títulos y descripciones
  • Dimensiones de imagen
  • Información del autor

Instalación

npm yarn pnpm

# Usando npm
npm install pinterest-scraper-api

# Usando yarn
yarn add pinterest-scraper-api

# Usando pnpm
pnpm add pinterest-scraper-api

Uso

Importación

// CommonJS
const pinterestScraper = require('pinterest-scraper-api');

// ES Modules
import pinterestScraper from 'pinterest-scraper-api';

Búsqueda Básica

async function getPinterestImages() {
  try {
    const images = await pinterestScraper.searchPinterest('paisajes naturales', 10);
    console.log(`Encontradas ${images.length} imágenes`);
    console.log(images);
  } catch (error) {
    console.error('Error en la búsqueda:', error);
  }
}

getPinterestImages();

Búsqueda Avanzada

async function busquedaAvanzada() {
  const opciones = {
    query: 'arquitectura moderna',
    limit: 25,
    timeout: 10000
  };
  
  const resultados = await pinterestScraper.searchPinterest(opciones.query, opciones.limit);
  return resultados;
}

API Reference

API Documentation Examples

searchPinterest(query, limit)

Busca imágenes en Pinterest y retorna sus enlaces directos.

Parámetros

| Parámetro | Tipo | Descripción | Valor por defecto | Requerido | |-----------|------|-------------|-------------------|-----------| | query | String | Término de búsqueda | - | ✅ Si | | limit | Number | Número máximo de resultados | 20 | ❌ No |

Valor de Retorno

Retorna una Promise que se resuelve con un array de objetos. Cada objeto contiene:

interface PinterestImage {
  id: string;          // ID único de la imagen
  title: string;       // Título de la imagen
  imageUrl: string;    // URL directo de la imagen
  originalUrl: string; // URL de Pinterest
  description: string; // Descripción de la imagen
  author: string;      // Nombre del autor
  width: number;       // Ancho en píxeles
  height: number;      // Alto en píxeles
}

Ejemplos

const fs = require('fs');
const https = require('https');
const pinterestScraper = require('pinterest-scraper-api');

async function descargarImagenes() {
  const imagenes = await pinterestScraper.searchPinterest('naturaleza', 5);
  
  imagenes.forEach((imagen, index) => {
    const file = fs.createWriteStream(`imagen_${index + 1}.jpg`);
    https.get(imagen.imageUrl, (response) => {
      response.pipe(file);
    });
  });
}
async function imagenesDimensiones() {
  const todasLasImagenes = await pinterestScraper.searchPinterest('wallpapers', 50);
  
  // Filtrar imágenes de alta resolución
  const imagenesHD = todasLasImagenes.filter(img => 
    img.width >= 1920 && img.height >= 1080
  );
  
  console.log(`Encontradas ${imagenesHD.length} imágenes HD`);
  return imagenesHD;
}
async function busquedaSegura(termino) {
  try {
    const imagenes = await pinterestScraper.searchPinterest(termino, 15);
    
    if (imagenes.length === 0) {
      console.log('No se encontraron imágenes para:', termino);
      return [];
    }
    
    return imagenes;
  } catch (error) {
    if (error.code === 'ECONNREFUSED') {
      console.error('Error de conexión - intenta más tarde');
    } else if (error.code === 'ETIMEDOUT') {
      console.error('Tiempo de espera agotado');
    } else {
      console.error('Error desconocido:', error.message);
    }
    return [];
  }
}

Contribuir

Contributors Issues Pull Requests

Las contribuciones son bienvenidas. Para cambios importantes, abre primero un issue para discutir qué te gustaría cambiar.

  1. Fork el proyecto
  2. Crea tu rama de feature (git checkout -b feature/AmazingFeature)
  3. Commit tus cambios (git commit -m 'Add some AmazingFeature')
  4. Push a la rama (git push origin feature/AmazingFeature)
  5. Abre un Pull Request

Soporte

GitHub Issues Discord Stack Overflow

¿Tienes problemas? ¿Necesitas ayuda? Estamos aquí para ti:

  • Reporta bugs en GitHub Issues
  • Únete a nuestro Discord para chat en tiempo real
  • Haz preguntas en Stack Overflow con el tag pinterest-scraper-api

Changelog

Releases

Consulta el CHANGELOG.md para ver todos los cambios de cada versión.

Licencia

MIT License

Este proyecto está licenciado bajo la Licencia MIT. Consulta el archivo LICENSE para más detalles.


¿Te gusta el proyecto? Dale una estrella

GitHub stars GitHub forks

Hecho con ❤️ por Studio Corporation Crew