Socialbel
A community-driven translation service

Socialbel API Documentation

Table of Contents

Introduction

The Socialbel API provides a simple way to request data from Socialbel.com via HTTP requests.

Overview

Warning This is a beta version of the API. All methods, data formats, error codes and outputs can be changed in the future

Data Types

 

Term

 

Property Type Description
id String Term id
text String Term contents
description String Description about the term
thumbsup Number Number of positive votes
thumbsdown Number Number of negative votes
parent String When it's a translation, parent has the parent term id
istranslation Boolean Is it a Term or a Translation?
created Date Created date on ISO 8601 format
updated Date Updated date on ISO 8601 format
language Object What language this term was created. See Language for more information
user Object Who create this. See User for more information

User

 

Property Type Description
id String username
name String Real name
profile String User's Profile URL
avatar String Photo or image
language String Native language. See Language for more information

Language

 

Property Type Description
code String Language code like "en", "pt_BR" or "es"
name String Language name like "English", "Brazilian Portuguese" or "Spanish"

Result Data Formats

All API requests output data on these formats ("json" is default):

Name Key Description Site
JSON json JSON (JavaScript Object Notation) is a lightweight data-interchange format json.org
XML xml Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML

Warning Not implemented yet

w3.org/XML

Example Call

http://socialbel.com/api/user/socialbel?format=json

Common arguments

Name Key Description
Format format Data format. See Result Data Formats for more information
Page page Current page (default 1)
Count count Items per page (default 20, max 100)
Callback callback When callback is defined and format is equal to "json", all output is returned like a funciton call, example:

http://socialbel.com/api/search/?query=socialbel&callback=myFunctionName

myFunctionName([{"id":"ABKxWQXJNU", ... }]);

Example Call

http://socialbel.com/api/user/socialbel?count=2&page=5

Error messages

Code Name
0 An unknown error occurred
1 Invalid format
2 No method specified
3 Missing required argument for this method
4 No results were returned

Methods

/api/search/ - Search

Search for terms and translations. Parameters:

Name Key Description
Query (required) query Query string
Username user Restrict your search for only terms from user
Language language Restrict your search for only terms in that language. Use only language code for now.

Result Structure

  • [] Array of Terms

Example Call

http://socialbel.com/api/search/?query=i+love+you

Example Response

/api/user/[USERNAME] - Fetch user information

Replace [USERNAME] with the user's username to retrieve him/her information and translations

Result Structure

  • user {} User Data Type
  • translations [] Array of Terms

Example Call

http://socialbel.com/api/user/socialbel

Example Response

/api/term/[TERM_ID] - Fetch term information

Replace [TERM_ID] with the term's id to retrieve translations

Result Structure

  • term {} Term Data Type
  • translations [] Array of Terms

Example Call

http://socialbel.com/api/term/bDCHivPLBg/

Example Response

/api/update/ - Create or update a term

Warinig Not implemented yet