3

When I run a sample query using the SE API browser (is that right term?), say against /questions for example (here), I'll always see something to the effect of:

...
  "quota_remaining": 9424,
  "quota_max": 10000,
  "has_more": true
}

Which tells me it's using a key and is not restricted by the 300 quota limit. A quick check through the Chrome debugger (or firebug) will reveal that the key it's using is key=U4DMV....

Now when I go to edit the default filter using:

scr1

And upon hitting save, I'm presented with the following:

scr2

And investigating this further in the Chrome debugger reveals:

{
  "error_id" :502,
  "error_name": "throttle_violation",
  "error_message": "too many requests from this IP, more requests availabe in 27628 seconds"
}

So basically what's happening here is that all queries generated when hitting the Run button use a key and are therefore not restricted to the 300 limit, whereas, the query used to build the filter doesn't use the said key (and is restricted). Would it be possible to update the filter builder to use the key as well?

Before someone points me to use /filters/create instead, I should mention that it doesn't appear to work for uber filters for whatever reason. Let me demonstrate:

Create a filter with the following parameters:

include:

.backoff;.error_id;.error_message;.error_name;.has_more;.items;question.accepted_answer_id;question.answer_count;question.body;question.bounty_amount;question.bounty_closes_date;question.closed_date;question.closed_reason;question.community_owned_date;question.creation_date;question.down_vote_count;question.favorite_count;question.is_answered;question.last_activity_date;question.last_edit_date;question.link;question.locked_date;question.migrated_from;question.migrated_to;question.owner;question.protected_date;question.question_id;question.score;question.tags;question.title;question.up_vote_count;question.view_count;access_token.access_token;access_token.account_id;access_token.expires_on_date;access_token.scope;badge.award_count;badge.badge_id;badge.badge_type;badge.link;badge.name;badge.rank;badge.user;badge_count.bronze;badge_count.gold;badge_count.silver;error.description;error.error_id;error.error_name;event.creation_date;event.event_id;event.event_type;filter.filter;filter.filter_type;filter.included_fields;inbox_item.answer_id;inbox_item.comment_id;inbox_item.creation_date;inbox_item.is_unread;inbox_item.item_type;inbox_item.link;inbox_item.question_id;inbox_item.site;inbox_item.title;info.answers_per_minute;info.api_revision;info.badges_per_minute;info.new_active_users;info.questions_per_minute;info.total_accepted;info.total_answers;info.total_badges;info.total_comments;info.total_questions;info.total_unanswered;info.total_users;info.total_votes;network_user.account_id;network_user.answer_count;network_user.badge_counts;network_user.creation_date;network_user.last_access_date;network_user.question_count;network_user.reputation;network_user.site_name;network_user.site_url;network_user.user_id;post.creation_date;post.last_activity_date;post.last_edit_date;post.owner;post.post_id;post.post_type;post.score;privilege.description;privilege.reputation;privilege.short_description;question_timeline.comment_id;question_timeline.creation_date;question_timeline.down_vote_count;question_timeline.owner;question_timeline.post_id;question_timeline.question_id;question_timeline.revision_guid;question_timeline.timeline_type;question_timeline.up_vote_count;question_timeline.user;reputation.on_date;reputation.post_id;reputation.post_type;reputation.reputation_change;reputation.user_id;reputation.vote_type;revision.comment;revision.creation_date;revision.is_rollback;revision.last_tags;revision.last_title;revision.post_id;revision.post_type;revision.revision_guid;revision.revision_number;revision.revision_type;revision.set_community_wiki;revision.tags;revision.title;revision.user;suggested_edit.approval_date;suggested_edit.comment;suggested_edit.creation_date;suggested_edit.post_id;suggested_edit.post_type;suggested_edit.proposing_user;suggested_edit.rejection_date;suggested_edit.suggested_edit_id;suggested_edit.tags;suggested_edit.title;tag.count;tag.has_synonyms;tag.is_moderator_only;tag.is_required;tag.name;tag.user_id;tag_score.post_count;tag_score.score;tag_score.user;tag_synonym.applied_count;tag_synonym.creation_date;tag_synonym.from_tag;tag_synonym.last_applied_date;tag_synonym.to_tag;tag_wiki.body_last_edit_date;tag_wiki.excerpt;tag_wiki.excerpt_last_edit_date;tag_wiki.tag_name;top_tag.answer_count;top_tag.answer_score;top_tag.question_count;top_tag.question_score;top_tag.tag_name;user.account_id;user.age;user.badge_counts;user.creation_date;user.display_name;user.is_employee;user.last_access_date;user.last_modified_date;user.link;user.location;user.profile_image;user.reputation;user.reputation_change_day;user.reputation_change_month;user.reputation_change_quarter;user.reputation_change_week;user.reputation_change_year;user.timed_penalty_date;user.user_id;user.user_type;user.website_url;user_timeline.badge_id;user_timeline.comment_id;user_timeline.creation_date;user_timeline.detail;user_timeline.post_id;user_timeline.post_type;user_timeline.suggested_edit_id;user_timeline.timeline_type;user_timeline.title;user_timeline.user_id

exclude:

answer.answer_id;answer.body;answer.comments;answer.community_owned_date;answer.creation_date;answer.down_vote_count;answer.is_accepted;answer.last_activity_date;answer.last_edit_date;answer.link;answer.locked_date;answer.owner;answer.question_id;answer.score;answer.title;answer.up_vote_count;.page;.page_size;.quota_max;.quota_remaining;.total;.type;comment.body;comment.comment_id;comment.creation_date;comment.edited;comment.link;comment.owner;comment.post_id;comment.post_type;comment.reply_to_user;comment.score;migration_info.on_date;migration_info.other_site;migration_info.question_id;question.answers;question.comments;related_site.name;related_site.relation;related_site.site_url;shallow_user.display_name;shallow_user.link;shallow_user.profile_image;shallow_user.reputation;shallow_user.user_id;shallow_user.user_type;site.aliases;site.api_site_parameter;site.audience;site.closed_beta_date;site.favicon_url;site.icon_url;site.launch_date;site.logo_url;site.markdown_extensions;site.name;site.open_beta_date;site.related_sites;site.site_state;site.site_type;site.site_url;site.styling;site.twitter_account;styling.link_color;styling.tag_background_color;styling.tag_foreground_color;badge.description;event.excerpt;event.link;inbox_item.body;info.site;network_user.user_type;post.body;post.comments;post.down_vote_count;post.up_vote_count;reputation.link;reputation.title;revision.body;revision.last_body;suggested_edit.body;tag.last_activity_date;tag_wiki.body;tag_wiki.last_body_editor;tag_wiki.last_excerpt_editor;user.about_me;user.answer_count;user.down_vote_count;user.question_count;user.up_vote_count;user.view_count;user_timeline.link

unsafe:

false

And this generates the error Invalid JSON returned. Inspecting this in the Chrome debugger reveals:

scr3

If you're wondering where I got the parameters for this uber filter, I used the default filter editor to select/unselect everything I needed, and sniffed out the request using the debugger.

Please let me know if you need me to clarify anything.

1 Answer 1

2

The API console in the documentation should attach it's key to all requests now.

For the filter creation error, what's happening there is actually a size check against the incoming parameters .NET enforces. A better error is returned now, but the proper course of action for a consumer remains the same; use POST when creating filters with a large # of includes/excludes.

POST is supported only on filters/create. If you want to continue using GET for ease (when adhoc-ing filters in a browser, for instance), consider using the base parameter which lets you create a filter with a delta (oftentimes a very small delta) from an existing filter.

2
  • Thanks Kevin, that took care of it. On a related note, I guess it isn't a big deal that the private key=U4DMV... is exposed since the restriction is IP based in any case, right? Commented Jan 30, 2012 at 20:35
  • 1
    @MarvinPinto - request keys aren't private, and yes it's because the throttle is IP based. Commented Jan 30, 2012 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .