How many signatures can we retrieve using the API?

123 views
Skip to first unread message

iv...@twobyfore.com

unread,
Mar 17, 2016, 11:48:59 AM3/17/16
to Change.org API
So from my understanding, this  call in the code below will get the 10 most recent signatures.  I was just wondering if it anyone knows if it's possible to get more than this (the /signatures according to the docs has been deprecated)? And if so, if there is an upper limit (maybe the first/last top 100).

<?php

  // get signatures for a Change.org petition
  function getChangePetitionSignatures($url){
    $CHANGE_API_KEY = 'aa21e02ce299f9742996d942844c71e24533eXXXX';
    $CHANGE_REQUEST_URL = 'https://api.change.org/v1/petitions/get_id';
    $parameters = array(
    'api_key' => $CHANGE_API_KEY,
    'petition_url' => $url
    );
    $query_string = http_build_query($parameters);
    $final_request_url = "$CHANGE_REQUEST_URL?$query_string";
    $response = file_get_contents($final_request_url);
    $json_response = json_decode($response, true);
    $petition_id = $json_response['petition_id'];
    //now get the petition details for signature count
    $parameters = array(
      'api_key' => $CHANGE_API_KEY,
      'petition_ids' => $petition_id
      );
    $query_string = http_build_query($parameters);
    $final_request_url = "$CHANGE_REQUEST_URL?$query_string";
    $response = file_get_contents($final_request_url);
  
    return $response;
    
  }
?> 

<?php echo 


?>

Matthew Kelley

unread,
May 21, 2017, 4:04:24 AM5/21/17
to Change.org API
Wow, it's been over a year and you've received no response on this? It would seem Change.org has zero support for developers regarding the API. The API seemed like a nice touch, but the examples and documentation on their Github page are outdated, things have been depreciated and overall the v1 API has been retired. 

from Readme.md (which was updated 2 years ago):

Change.org Developer Documents
This version of the Change.org API has been retired. While endpoints should continue to work as documented, we will no longer be providing support or bug fixes.
Reply all
Reply to author
Forward
0 new messages