Is there any website / API for hosting photos on the web?

I would like to know if there is any API that makes it possible to host photos on the web.

Example:

cloud.push(arquivo, callback, fail);

I will use this API for the purpose of enabling users to host images for profile picture, etc (currently I do this using base64, but it takes up a lot of space).

I'd like to know a way to do this.

 16
Author: Comunidade, 2014-02-25

4 answers

In addition to Flickr, here are some of the many popular options:

  • Imgur: an extremely popular service ( Wikipedia article ) to host photos. Exposes a Rest API with JSONP and XML support. The API is free for non-commercial use and upload up to 1250 photos per day (see limits); it also has business plans between mens 25 and mens 500 monthly. Requires registration and authentication (OAuth 2.0).
  • Uploads.im: free and unlimited Russian services (in addition to the maximum image size restriction on 10 MB). In addition to popular formats for web images, it supports PSDs and PDFs. It has API REST with support for JSON (P), XML, text or redirect formats (in the latter after a POST API redirects to the image viewer). No registration or authentication required.
  • ImageShack: commercial service for uploading images and videos (the free service was recently discontinued, but a 30-day trial is still available). Registrations range from U 2 to U 100. Exposes API REST with support for JSON and XML formats. Requires registration, obtaining key for access and OAuth 2.0 authentication.
  • Cloudinary: cloud image management service. It has a free plan (limits: 500 MB of space, 50,000 images and 1 GB of bandwidth / month) and plans commercial with prices between U 39 and U 219. It uses Amazon S3 and provides CDN, automatic backup services, image manipulation services, effects, watermark face detection, Sprite creation, etc. It has REST APIs with key-based authentication, as well as libraries for various platforms (including PHP).
  • Picasa Web - Google service to host photos and videos based on feeds . It's free as per the limits of Picasa Web / Google+ (1GB of storage, where photos smaller than 2048x204 and / or videos smaller than 15 minutes do not consume space for Google+ users). Extra space can also be purchased ( 100 GB for {4.99 ) and the service scales easily to TBS storage for applications with that need. In addition to direct access through the protocol based on feeds there are libraries for various platforms, including PHP (currently only for API version 1.0). Authentication options via OAuth 2.0, OAuth 1.0 AuthSub or "installed" (login / password).

Another option besides implementing a mechanism for storing and retrieving profile pictures on hand is to use Gravatar. Gravatar allows the user to associate an identity (including photos) with their email address. In this way your application becomes a simple consumer of the profile image of the user ( see example PHP code ).

The same can be done with social login . Sites like Facebook, Twitter and Google+ exposes authentication mechanisms and access to the user's profile. Libraries such as HybridAuth and Janrain allow users of your site to authenticate with popular providers (as well as any other that supports OpenID ) and expose a common API for your application to consume easily user information (including profile picture) without you having to worry about each provider's implementation details.

In short, there are many options for what you want, but the first exercise to be done (before we talk about code) is to better understand what your real requirements are and, from these, choose the best solution for your application.

 19
Author: Anthony Accioly, 2014-02-25 06:05:36

You can use the Flickr API

Https://www.flickr.com/services/api /

Upload

Https://www.flickr.com/services/api/upload.api.html

Photos should be posted at the following URL:

https://up.flickr.com/services/upload/

Arguments

  • Photo - the file for upload.

  • Title (optional) - the title of the photo.

  • Description (optional) - a description of photo. It may contain some limited HTML.

  • Tags (optional) - A list of tags separated by spaces to apply to the photo.

  • Is_public, is_friend, is_family (optional) - Set to 0 for no and 1 for Yes. Specifies who can view the photo.

  • Safety_level (optional) - Set 1 for Safe, 2 for moderate, or 3 for Restricted.

  • Content_type (optional) - Set 1 for Photo, 2 for screenshot, or 3 for other

  • Hidden (optional) - Set 1 to show photos in all search results, 2 to not show in public searches.

 6
Author: Tony, 2014-02-25 12:43:12

Imgur is a good option. The link is in English, but points to a Python library and Android and JavaScript examples. The policy for non-commercial use is quite reasonable.

 3
Author: chesterbr, 2014-02-25 02:49:50

There is Amazon S3 (Simple Storage Service) It is the most used option by small sites and startups. This is an online file storage service offered by Amazon Web Services, which provides public file transfers via REST, SOAP and BitTorrent.

This is a paid service, but very cheap, it is charged something around US 0.15 per gigabyte transferred per month.

Step by step how to use the service:

 2
Author: Gabriel Santos, 2014-02-25 18:49:33