Is there a Website/API to host photos on the web?

Asked

Viewed 3,235 times

16

I wonder 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 photo, 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.

  • 2

    Take a look here (in English) - is the same service used by Stack Exchange.

  • @bfavaretto The response field is down there

  • 1

    can use Amazon’s CDN too, but it’s not free.

  • 2

    @Emersonrochaluiz O laziness to give more details... there is as comment same.

  • The Imgur API has been very complicated since version 3...

4 answers

19


Besides Flickr, here are some of the many popular options:

  • Imgur: An extremely popular service (wikipedia article) to host photos. Displays a API REST with JSONP and XML support. The API is free for non-commercial use and upload up to 1250 photos per day (see limits); also has business plans between $25 and $500 monthly. Requires registration and authentication (Oauth 2.0).
  • Uploads.im: Free and unlimited Russian services (plus the maximum image size restriction of 10 MB). In addition to popular formats for web images, it accepts Psds and Pdfs. It has API REST supporting JSON (P), XML, TEXT or Redirect formats (at last after a POST API redirects to image viewer). Does not require registration or authentication.
  • Imageshack: Commercial service for uploading images and videos (the free service was recently discontinued, but a trial 30 days is still available). Registrations range from U$2 to U$100. Exhibits API REST supports JSON and XML formats. Requires registration, key retrieval for access and Oauth 2.0 authentication.
  • Cloudinary: Cloud image management service. Features a free plan (limits: 500 MB of space, 50,000 images and 1 GB of bandwidth / month), and business plans with prices between U$39 and U$219. Uses Amazon S3 and provides CDN, automatic backup services, image manipulation services, effects, watermark face detection, creating sprites, etc. Features REST API with key-based authentication, plus multi-platform libraries (including PHP).
  • Picasa Web - Google service to host photos and videos based on feeds. It is free according to the limits Picasa Web / Google+ (1GB of storage, photos smaller than 2048x204 and / or videos smaller than 15 minutes do not consume space for users of Google+). 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 via protocol based on feeds libraries exist 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 implementing a mechanism to store and retrieve profile images at hand is to use the Engrave. Gravatar allows you to associate an identity (including photos) with your email address. This way your application becomes a simple consumer of the user profile image (see example of PHP code).

The same can be done with Social login. Sites like Facebook, Twitter and Google+ exposes authentication mechanisms and access to the user profile. Libraries such as Hybridauth and Janrain allow users of your site to authenticate with popular providers (as well as any others who support Openid) and expose a common API so that your application easily consumes user information (including profile photo) 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.

  • Good answer! : ) Thanks for the tips. Someone knows the conditions of the service, i.e., if the images become the property of the service holders?

  • Hi walrus, on intellectual property issues, just reading the terms of service of each site. I am no expert in the subject, but in the average the sites do not give you any guarantee, ask you to do upload only of content legitimately yours. Generally the terms of service provide for a free license for the site to do as it pleases with the images, but this does not mean that the intellectual property is no longer yours (it just means that you cannot process the site).

  • Thanks for the tip, Anthony! It’s like I always say, "Don’t read the contracts, then screw up!" :)

6

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 in the following URL:

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

Arguments

  • photo - The file to upload.

  • title (optional) - #The photo title.

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

  • tags (optional) - #A space-separated list of tags 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 to Safe, 2 to Moderate, or 3 to Restricted.

  • content_type (optional) - Set 1 to Photo, 2 to Screenshot, or 3 to Other

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

  • can you leave an example as well? = P

  • Tutorial Example in php http://davidwalsh.name/flickr-php (Upload Photos to Flickr with PHP)

3

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.

2

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

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

Step by step how to use the service:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.