Ping Submission API

Ping Sindice to make sure that your RDF data is promptly indexed (or refreshed) within our services. To do this use the following APIs:

REST API

The REST API for ping submission can be reached through: http://api.sindice.com/v2/ping.
Example using curl to post a list of url from text file:

curl -H "Accept: text/plain" --data-binary @urls.txt  http://api.sindice.com/v2/ping

The file should contain urls in one per line format.
Note: Due to potential abuse, the REST API for ping submitting might be deactivated in the future.

NOTICE:
The old url http://sindice.com/api/v2/ping is deprecated and will soon be retired.
All users should switch to the new one http://api.sindice.com/v2/ping

RPC API 

The Sindice RPC ping API  is developed according to the specification of the Pingback mechanism. The RPC method name has been adjusted to fit the majority of software that have pingback support (such as blogging engines).

The XML-RPC endpoint: http://sindice.com/xmlrpc/api

Method name: weblogUpdates.ping

Parameters:

  • name of the resource - String, this can be left empty but the parameter should not be omitted.
  • URL of the resource - String

Note: parameters should be sent in the exact order listed above

Response parameters:

  • flerror - Boolean, value 1 indicates that an error occured
  • message - String, contains the error message if flerror is 1, otherwise it will contain the string "Thanks for pinging Sindice.com"

Example of an XML-RPC Request message:

<?xml version="1.0"?>
<methodCall>
     <methodName>weblogUpdates.ping</methodName>
     <params>
         <param>
             <value>Some resource title</value>
         </param>
         <param>
             <value>http://www.w3.org/People/Berners-Lee/card.rdf</value>
         </param>
     </params>
</methodCall>

Example of a XML-RPC Response message:

<?xml version="1.0"?>
 <methodResponse>
     <params>
         <param>
             <value>
                 <struct>
                     <member>
                         <name>flerror</name>
                         <value>
                             <boolean>0</boolean>
                         </value>
                     </member>
                     <member>
                         <name>message</name>
                         <value>Thanks for pinging Sindice.com</value>
                     </member>
                 </struct>
             </value>
         </param>
     </params>
</methodResponse>

 This Java code will do this for you:

/**
 * Performs a Ping to Sindice with a list of URLs.
 * @param urls
 */
public void doPing(List<URL> urls) {
    if (urls.size()<=0) return;
    StringBuffer buf = new StringBuffer();
    for (URL url : urls) {
        buf.append(url+"\n");
    }
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    try {
        config.setServerURL(new URL("http://sindice.com/xmlrpc/api"));
        XmlRpcClient client = new XmlRpcClient();
        client.setConfig(config);
        Object[] params = new Object[]{
        	"(Optional)The name of your application here", buf.toString()
        	};
        Object result = client.execute("weblogUpdates.ping", params);
        System.out.println("Sent: "+buf.toString()+"Result: "+result);
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (XmlRpcException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

 This PHP code will do this for you:

function doPing($title, $URI) {
    $client = new xmlrpc_client(" http://sindice.com/xmlrpc/api");
    $payload = new xmlrpcmsg("weblogUpdates.ping");
   
    $payload->addParam(new xmlrpcval($title));
    $payload->addParam(new xmlrpcval($URI));
   
    $client->setDebug(2);
   
    $response = $client->send($payload);
    $xmlresponsestr = $response->serialize();
   
    $xml = simplexml_load_string($xmlresponsestr);
    $result = $xml->xpath("//value/boolean/text()");
     if($result) {
        if($result[0] == "0"){
            echo "<p>Submitting $URI to $servicetitle succeeded.</p>";
            return;
        }
    }
    else {
        $err = "Error Code: " 
        .$response->faultCode() 
        ."<br /> Error Message: " 
        .$response->faultString();
        echo "<p>Failed to submit $URI to $servicetitle.</p>";
    }
}

SITEMAP SUBMISSION API

There is a dedicated API for submitting Semantic Sitemaps. To submit a sitemap, send an HTTP POST request to this URI:

  http://api.sindice.com/v2/sitemap

The body of the request must be in application/x-www-form-urlencoded format. The parameters are:

  • url - the URI of the sitemap, e.g. http://example.com/sitemap.xml
  • email (optional) - your email address

If an email address is provided, then Sindice will send you a message when your dataset has been indexed. This is what a full HTTP request to the API looks like (including HTTP headers):

  POST /api/v1/sitemap HTTP/1.0
  Host: sindice.com
  Content-Type: application/x-www-form-urlencoded

  url=http%3A%2F%2Fexample.com%2Fsitemap.xml&email=webmaster%40example.com