Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
SwiftyInsta — Instagram Private API Swift | Kitploit
Herramientas/GitHubGitHub/them4hd1/swiftyinsta
OSINT (Inteligencia de Fuentes Abiertas)Scripting y AutomatizaciónRecopilación de InformaciónIngeniería Social
GitHubthem4hd1/swiftyinsta

SwiftyInsta

Instagram Private API Swift

Ver Repositorio
23049hace 4 añosRevisado por Kitploit

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

SwiftyInsta (legacy)

Tenga en cuenta que SwiftyInsta ya no se mantiene activamente.
Consulte #244 para más información.
Eche un vistazo a Swiftagram si busca alternativas actualizadas.


CI Status Version License Platform

Instagram ofrece dos tipos de API para desarrolladores. La Plataforma de la API de Instagram (extremadamente limitada en funcionalidad y a punto de ser descontinuada) y la API Graph de Instagram solo para cuentas de Business y Creator.

Sin embargo, las aplicaciones de Instagram dependen de un tercer tipo de API, la llamada API Privada o API No Oficial, y SwiftyInsta es un cliente para iOS, macOS, tvOS y watchOS para ellas, escrito completamente en Swift. Puede intentar crear una mejor experiencia de Instagram para sus usuarios, o escribir bots para automatizar diferentes tareas.

Estas API Privadas no requieren token ni registro de aplicación, pero no están autorizadas por Instagram para uso externo. Úselo bajo su propio riesgo.

Instalación

Swift Package Manager (Xcode 11 y superior)

  1. Seleccione File/Swift Packages/Add Package Dependency… del menú.
  2. Pegue https://github.com/TheM4hd1/SwiftyInsta.git.
  3. Siga los pasos.

CocoaPods

CocoaPods es un gestor de dependencias para proyectos Cocoa. Puede instalarlo con el siguiente comando:

root@kitploit:~
$ gem install cocoapods

Para integrar SwiftyInsta en su proyecto Xcode usando CocoaPods, especifíquelo en su Podfile:

root@kitploit:~
use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftyInsta', '~> 2.0'
end

Luego, ejecute el siguiente comando:

root@kitploit:~
$ pod install

SwiftyInsta depende de CryptoSwift y keychain-swift.

Inicio de sesión

Credenciales

root@kitploit:~
// these need to be strong references.
self.credentials = Credentials(username: /* username */, password: /* password */, verifyBy: .text)
self.handler = APIHandler()
handler.authenticate(with: .user(credentials)) {
    switch $0 {
    case .success(let response, _):
        print("Login successful.")
        // persist cache safely in the keychain for logging in again in the future.
        guard let key = response.persist() else { return print("`Authentication.Response` could not be persisted.") }
        // store the `key` wherever you want, so you can access the `Authentication.Response` later.
        // `UserDefaults` is just an example.
        UserDefaults.standard.set(key, forKey: "current.account")
        UserDefaults.standard.synchronize()
    case .failure(let error):
        if error.requiresInstagramCode {
            /* update interface to ask for code */
        } else {
            /* notify the user */
        }
    }
}

Una vez que el usuario haya escrito el código de autenticación de dos factores o el código de desafío, simplemente haga

root@kitploit:~
self.credentials.code = /* the code */

Y el completionHandler en el anterior authenticate(with: completionHandler:) capturará automáticamente la respuesta.

LoginWebViewController

root@kitploit:~
let login = LoginWebViewController { controller, result in
    controller.dismiss(animated: true, completion: nil)
    // deal with authentication response.
    guard let (response, _) = try? result.get() else { return print("Login failed.") }
    print("Login successful.")
    // persist cache safely in the keychain for logging in again in the future.
    guard let key = response.persist() else { return print("`Authentication.Response` could not be persisted.") }
    // store the `key` wherever you want, so you can access the `Authentication.Response` later.
    // `UserDefaults` is just an example.
    UserDefaults.standard.set(key, forKey: "current.account")
    UserDefaults.standard.synchronize()
}
if #available(iOS 13, *) {
    present(login, animated: true, completion: nil) // just swipe down to dismiss.
} else {
    present(UINavigationController(rootViewController: login),  // already adds a `Cancel` button to dismiss it.
            animated: true,
            completion: nil)
}

O implemente su propio UIViewController personalizado usando LoginWebView, y páselo a un método authenticate de APIHandler usando .webView(/* your login web view */).

Authentication.Response

Si ya ha persistido el Authentication.Response de un usuario:

root@kitploit:~
// recover the `key` returned by `Authentication.Response.persist()`.
// in our example, we stored it in `UserDefaults`.
guard let key = UserDefaults.standard.string(forKey: "current.account") else { return print("`key` not found.") }
// recover the safely persisted `Authentication.Response`.
guard let cache = Authentication.Response.persisted(with: key) else { return print("`Authentication.Response` not found.") }
// log in.
let handler = APIHandler()
handler.authenticate(with: .cache(cache)) { _ in
    /* do something here */
}

Uso

Todos los endpoints son fácilmente accesibles desde su instancia de APIHandler.

root@kitploit:~
let handler: APIHandler = /* a valid, authenticated handler */
// for instance you can…
// …fetch your inbox.
handler.messages.inbox(with: .init(maxPagesToLoad: .max),
                       updateHandler: nil,
                       completionHandler: { _, _ in /* do something */ })
// …fetch all your followers.
handler.users.following(user: .me,
                        with: .init(maxPagesToLoad: .max),
                        updateHandler: nil,
                        completionHandler: { _, _ in /* do something */ })

Además, las respuestas ahora muestran cada valor contenido en el archivo JSON devuelto por la API: simplemente acceda a cualquier ParsedResponse rawResponse y comience a navegar, o quédese con los accesorios sugeridos (por ejemplo, username, name, etc. de User y aspectRatio, takenAt, content, etc. de Media).

Contribuciones

Las pull requests y los issues son más que bienvenidos.

Autores

  • Mahdi Makhdumi (@TheM4hd1), 1.* mantenedor
  • Stefano Bertagno (@sbertix), 2.* mantenedor

Estamos buscando activamente mantenedores.
Consulte #244 para más información.

Licencia

SwiftyInsta está licenciado bajo la licencia MIT. Consulte LICENSE para más información.

Descargar herramienta