igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Function MediaLike

    • Likes a media. The wire is the application profile's, not the caller's choice: it reads MobileApplicationState.mediaLikeWire (the REST api/v1/media/<id>/like/ or the graphql_www LikeMutation). The presented 451 profile declares the mutation; a 448/450-era profile declares the REST like. A profile that declares nothing is no evidence of a wire (the iOS like is not modelled), so the brick dies with MobileMediaLikeWireNotDeclaredError (a defect of the build, not a typed failure) instead of sending a request. See the field's own note and its open item.

      The surface names one of the app's three like layouts — the contextual feed ('feed'), the reels viewer ('reels') and the home timeline's carousel child ('timeline'); see MediaLikeSurface. The first two have a form on both wires; the timeline's is the GraphQL build's only (the app has no REST form of it), so on a profile that declares the REST wire this brick dies with a defect that says so before any request — the library has no layout to send there, which is the library's gap, not a state a caller can answer.

      Parameters

      Returns Effect<
          | {
              data: {
                  xig_media_like: {
                      media: {
                          __typename?: string;
                          has_liked: boolean;
                          id: string;
                          strong_id__?: string;
                      };
                  };
              };
          }
          | MediaLikeRestResponse,
          | IgApiError
          | RequestError
          | ParseError
          | TransportError
          | SchemaError
          | GraphqlRootFieldMissingError,
          | PlainJsonApiHttp
          | Signature
          | MobileSession
          | MobileDevice
          | GraphqlJsonHttp
          | MobileApplication
          | NavigationWire,
      >