Is there a Site / API for hosting photos on the web?

16

I wonder if there are any APIs that allow you to host photos on the web.

Example:

cloud.push(arquivo, callback, fail);

I'm going to use this API to enable users to host images for profile photo, etc. (I currently do this using base64, but it takes a lot of space).

I would like to know a way to do this.

    
asked by anonymous 25.02.2014 / 02:50

4 answers

17

In addition to Flickr, follow 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 of up to 1250 photos per day (see boundaries ); you also have business plans between $ 25 and $ 500 a month. Requires registration and authentication (OAuth 2.0).
  • Uploads.im : Free and limitless Russian services (in addition to restricting the maximum image size to 10 MB). In addition to popular formats for web images, it supports PSDs and PDFs. Has API REST with support for JSON (P), XML, TEXT, or Redirection formats (in the latter after a POST the API redirects to the viewer). No registration or authentication required.
  • ImageShack : Commercial service for uploading images and videos (the free service has recently been discontinued, but a trial of 30 days is still available). Entries range from $ 2 to $ 100. Exposes REST API with support for JSON and XML formats. Requires registration, obtaining key for access and authentication OAuth 2.0.
  • Cloudinary : Image management service in the cloud. It has a free plan (limits: 500 MB of space, 50,000 images and 1 GB of band / month) and commercial plans priced between US $ 39 and $ 219. It uses Amazon S3 and provides CDN, automatic backup services, image manipulation services, effects, watermark face detection, creation of sprites , etc. It has a REST API with key-based authentication, as well as multi-platform libraries (including PHP ).
  • Picasa Web - Google service for hosting photos and videos based on feeds . It's free as per Picasa Web / Google+ limits (1GB of storage, with photos smaller than that 2048x204 and / or videos shorter than 15 minutes do not consume space for Google+ users). Extra space can also be purchased ( 100 GB for $ 4.99 ) and the service easily scales to storage TBs for applications with this need . In addition to direct access through the feeds protocol, there are libraries for various platforms, including PHP (currently only for version 1.0 of the API). Authentication options via OAuth 2.0, OAuth 1.0 AuthSub or "installed" (login / password).

Another option besides deploying a mechanism to store and retrieve profile images at hand is to use Gravatar . Gravatar allows the user to associate an identity (including photos) with his or her email address. This way your application becomes a simple consumer of the user profile image ( see PHP code example ).

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

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 .

    
25.02.2014 / 05:57
6

You can use the Flickr API

link

Upload

link

Photos must be POSTED at the following URL:

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

Arguments

  • photo - The upload file.

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

  • description (optional) - A description of the 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 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 Screen Capture, or 3 for Other
  • hidden (optional) - Set 1 to show photos in all search results, 2 not to show in public searches.

25.02.2014 / 03:12
3

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

    
25.02.2014 / 03:49
2

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

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

Step by step how to use the service:

  • How to create an account and store the images manually.
  • How to upload images programmatically:

  • How to access the images: (Sample URLs)

    • s3.amazonaws.com/seuBucket/suaPasta/yourFile.png
    • seuBucket.s3.amazonaws.com/suaPasta/yourArchive.png
25.02.2014 / 19:49