API and Tools
/
Get, Create, Update and Delete Albums

Show photos of locr on your Website or in your program


With the locr API, you can show the locr photos on your website or in your own program. The locr placed photos are perfect suitable, to illustrate your own maps, words and datasets, where places are in focus (e.g. immovables, hotels, routes, resorts).


functionality:

It's a very simple REST-API, you only have to do a GET-Request

1. Functions:

1.1. get_albums: Demo

1.1.1. Parameter
User Authorization
user_name or user_id:
Get one specified photo
start:
Startvalue from database (Standard = 0)
count:
maximum numbers of entries (Standard = 10, max = 500)
search_tag:
Searchvalue for tag
search_name:
Search value for a caption
search_description:
Search value for a caption
category:
  • popularity (Popular Photos) (Standard)
  • rating (Highest Rated Photos)
  • created
  • name
1.1.2. Examples
http://www.locr.com/api/get_albums_xml.php?search_tag=braunschweig
http://www.locr.com/api/get_albums_json.php?search_tag=braunschweig

1.2. update_album: Demo

1.2.1. Parameter
User Authorization*
id*
name
description:
Description of the photo
tags:
Your comma separated tags
1.2.2. Examples
http://www.locr.com/api/update_album_xml.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&id=123456789&tags=test, braunschweig
http://www.locr.com/api/update_album_json.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&id=123456789&tags=test, braunschweig

1.3. delete_album: Demo

1.3.1. Parameter
1.3.2. Examples
http://www.locr.com/api/delete_album_xml.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&id=123456789
http://www.locr.com/api/delete_album_json.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&id=123456789

1.4. create_album: Demo

1.4.1. Parameter
User Authorization*
name*
description:
Description of the photo
tags:
Your comma separated tags
1.4.2. Examples
http://www.locr.com/api/create_album_xml.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&name=test_album&description=this is a test
http://www.locr.com/api/create_album_json.php?auth_user_name=testuser&api_signature=8b55eac3b2291b201fc59cd8b76410ab&auth_token=c8b066236c8cbcc280921b93f24e281a&name=test_album&description=this is a test

2. Example answers:

XML JSON
<?xml version="1.0"?>
<album_list status="ok">
  <albums>
    <album>
      <id>1234567</id>
      <name>testalbum</name>
      <privacy>0</privacy>
      <photos_count>10</photos_count>
      <thumbnail_id>12345</user_url>
      <thumbnail_url>
        http://www.locr.com/photos/000/8e/c3/8ec3d8a2b16290640a85c6ea7c185f18_SQ.jpg
      </thumbnail_url>
      <description>test description</description>
      <tags>test, braunschweig</tags>
      <created>2008-02-10 00:00:00</created>
      <owner_name>testuser</user_name>
      <user_url>http://www.locr.com/profile/testuser</user_url>
    </album>
    <album>
      <id>1234568</id>
      <name>testalbum 2</name>
      <privacy>0</privacy>
      <photos_count>16</photos_count>
      <thumbnail_id>12346</user_url>
      <thumbnail_url>
        http://www.locr.com/photos/000/8e/c3/8ec3d8a2b16290640a85c6ea7c185f62_SQ.jpg
      </thumbnail_url>
      <description>test description 2</description>
      <tags>test 2, braunschweig</tags>
      <created>2008-02-30 00:00:00</created>
      <owner_name>testuser</user_name>
      <user_url>http://www.locr.com/profile/testuser</user_url>
    </album>
    ...
  </photos>
</photo_list>

3. Error codes:

3.1. codes:

100: Database Error
if database is not available
101: Access Denied
the IP address was locked
200: Invalid Value
unknown value for the parameter listed in "value"
201: Missing Parameter
required parameter was not set listed in "value"
202: Missing Value
parameter was set, but value is empty, parameter listed in "value"
203: Value is not a number
parameter was set, but value is not a number, parameter listed in "value"
204: Value is out of Range
value is a number, but out of a valid range, parameter listed in "value"
205: User not found
user-id or username is not in database, parameter listed in "value"
206: Incorrect Authentification
Incorrect auth_token, api_signature, username or password, parameter listed in "value"
207: Permission Denied
you don't have the rights to view this
208: Parameter is readonly
the parameter listed in "value" is readonly
209: Wrong Format
the file you've uploaded is not jpg
210: Upload Limit exceeded
you've exceeded your upload limit
211: Photo already uploaded
the photo you've uploaded already exists
212: Photo don't exists
the photo you're trying to get ist don'nt exists
213: Album Name already exists
the album name you want to set already exists
214: No more Albums allowed
you've exceeded the allowed numbers of albums
215: Album not found
the album you want to get don't exists

3.2. Examples:

XML JSON
<?xml version="1.0"?>
<album_list status="fail">
  <info>
    <error code="202" message="Missing Value">
      <value>search</value>
    </error>
  </info>
  <albums>
  </albums>
</album_list>

4. Result values:

privacy:
  • 0       -> Public
  • 500   -> Friends
  • 800   -> Family
  • 1000 -> Private
* = Obligatory


Conditions
Every photo displayed on your Website have to include our name or our logo. A link to the photo page (e.g. http://www.locr.com/photo_detail.php?id=123456) at Locr.com is also a requirement. Under the photo have to be displayed the name of the author linked to his area at Locr (e.g. http://www.locr.com/profile/testuser). Also somewhere in your site you need to include the text "Photos provided by Locr are under the copyright of their owners."

Terms of use
If you have non-commercial interests, you can use the API without asking for permission. If you want to make a profit with the API, it is commercial and you need our explicit authorization. Please contact us under info@locr.com. Further Information under GTB.

Questions
If you have suggestions or questions, just contact us under info@locr.com