Web sharing API

This is our basic read-only API. This API was designed to facilitate Twitter client authors to show our users’ content inline in tweet feeds, and our users to integrate their Camera+ photo feed into their blogs or websites. But we're looking forward to seeing what you can do with it!

Contents

Basics

Currently this API requires no authentication, registration, or API keys. This may change in the future as traffic increases.

You can help us keep this policy by keeping your code sane. Use caching as much as possible. When using the API in web applications, do not make service requests on each page load - load the information from our service the first time you need it, and then cache it locally on your own servers.

Formats

Any call that returns data can return data as JSON or XML by specifying the required format in the &format= GET parameter. If you don’t specify a format, the default is JSON.

Format

GET parameter

Configuration

JSON

&format=json

None

JSONP

&format=json

&callback=jsonpFunctionName

XML

&format=xml

None

Plain text

&format=plaintext

None

Link scanning

A common case will be that you are scanning a feed or text for links to our services, for instance a Twitter client looking for tweeted images, or an IM client looking for quoted photos. The following table lists links that are of interest to API consumers. Any reference that isn't in the table must be treated as a regular web link. They may lead to our product pages, blog posts, or other such content.

Links to our services may appear with the domains campl.us or camerapl.us. You must support both these domains, we are currently in the process of migrating to the latter.

Picture pages

Each time a user shares one or more photos, a page is created. Unlike most other photo sharing services, there can be more than one photo shared per page.

Picture pages are identified by their short URLs such as http://campl.us/hHAP (or http://camerapl.us/hHAP). The domains also host other, non-picture pages. These can be distinguished easily as they will always contain a forward-slash (/) somewhere in the path, possibly as a trailing character. If you try to make API requests on a non-picture page, you will get an HTTP 404 error.

To get information for page, make an HTTP request to the short url with one of the following extensions:

Thumbnails

Use of these single thumbnails are discouraged, as picture pages often contain more than one image. The recommended method is to use the :urls data call (described below) and show multiple images, or use :count and show a number badge and link to the original page. Read more in our Twitter client recommendations

URL extension

Description

Example

:120px

HTTP redirect to the maximum 120px dimensions scaled version of the first image on the page.

Twitter client UX recommendations

Camera+ presents a slightly unique challenge in that it’s the only service where users regularly share multiple pictures with a single link. When a twitter client sees a picture url, it should read the :urls data, and show a list or grid of all the thumbnails on the page. If space is at a premium, clients can read the :count variable, show only the first thumbnail with a badge in the corner showing the total number of photos, and link to the original page when the user taps the thumbnail.

When displaying more than one image, you can link to anchors on the linked page by using the word “photo” and sequential numbers starting at 1. E.g. link to the third image on a page with http://campl.us/hvaI#photo3

Example: WordPress plugin

This sample WordPress plugin will run hourly in cron and take anything you post on your Twitter stream on campl.us and post it in your blog.