title: How to get blog posts by label in blogger api
body: <p>I using <a href="https://developers.google.com/blogger/docs/3.0/using" rel="nofollow noreferrer">blogger api</a> in my android app to integrate blogger content with it by using the REST APIs, as a JSON's objects.</p>
  
  <p>I need to retrieve/filter posts by a label. In most blogs the link of blog's label it usually is</p>
  
  <pre><code>https://abtallaldigital.blogspot.com/search/label/Food
  https://abtallaldigital.blogspot.com/search/label/Technology
  </code></pre>
  
  <p>I read all API documentation and I see it's deal with Blogs, Posts, Comments, Pages, Users but there's nothing to handle labels/categories in it.</p>
  
  <p>There's a class BloggerAPI in the app that's used to retrieve blogs</p>
  
  <pre><code>package abtallaldigital.blogspot.com.dummyapp;
  
  import retrofit2.Call;
  import retrofit2.Retrofit;
  import retrofit2.converter.gson.GsonConverterFactory;
  import retrofit2.http.GET;
  import retrofit2.http.Url;
  
  public class BloggerAPI {
  
      public static final String BASE_URL =
              "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/";
      public static final String KEY = "THE-KEY";
  
      public static PostService postService = null;
  
      public static PostService getService() {
  
          if (postService == null) {
              Retrofit retrofit = new Retrofit.Builder()
                      .baseUrl(BASE_URL)
                      .addConverterFactory(GsonConverterFactory.create())
                      .build();
              postService = retrofit.create(PostService.class);
          }
  
          return postService;
      }
  
      public interface PostService {
          @GET
          Call&lt;PostList&gt; getPostList(@Url String url);
      }
  }
  </code></pre>
  
  <p>It is used thus</p>
  
  <pre><code>  private void getData(){
  
      String url = BloggerAPI.BASE_URL + "?key=" + BloggerAPI.KEY;
  
      if(token != ""){
          url = url+ "&amp;pageToken="+token;
      }
      if(token == null){
          return;
      }
  
     final Call&lt;PostList&gt; postList = BloggerAPI.getService().getPostList(url);
      postList.enqueue(new Callback&lt;PostList&gt;() {
          @Override
          public void onResponse(Call&lt;PostList&gt; call, Response&lt;PostList&gt; response) {
              PostList list = response.body();
              token = list.getNextPageToken();
              items.addAll(list.getItems());
              adapter.notifyDataSetChanged();
              Toast.makeText(MainActivity.this, "Sucess", Toast.LENGTH_LONG).show();
          }
  
          @Override
          public void onFailure(Call&lt;PostList&gt; call, Throwable t) {
              Toast.makeText(MainActivity.this,"Error occured",Toast.LENGTH_LONG).show();
              Log.i(TAG, "onFailure: "+t.toString());
          }
      });
  
  }
  </code></pre>
  
  <p>I googling for how to get a link of RSS Feed for any label and I found this result</p>
  
  <pre><code>https://example.blogspot.com/feeds/posts/default/-/label/?alt=rss
  </code></pre>
  
  <p>this will gets the blog posts of any label with replacing the word "label" in the link</p>